飞飞世界论坛

标题: 修复交换错误 [打印本页]

作者: admin    时间: 2016-1-10 03:43
标题: 修复交换错误
Hi I fixed the swap bug a long time ago it got tested on my server and it worked . p( j0 b" y1 d% d) B: ^4 c
I posted this because someone kinda posted a youtube thingy about it :O.
. q( u/ T7 G  ^3 U( H) P% R. \  |& ]  w' [1 P& G
Find this in DPSrv.cpp @ worldserver  f' |& d5 t: Q6 ~, ?3 u  Y
9 L7 N$ P* m  E% Q' r  z9 K
Code:
6 H9 s8 z  |3 vvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )1 r7 n9 `, w0 r9 ^' N8 j, B
{1 {$ e# u. L6 W7 P
        DWORD nId;
- \. R2 h' U! F+ i7 n        int nPart;
! ~6 I! U$ [( u4 h6 k  U6 Z9 m6 k, F; V. B
        ar >> nId;
# j; D- h) t) o        ar >> nPart;               
2 C& }1 r+ m3 a; w4 C4 _1 H        ! u! T7 o. l$ e5 L- M$ E
        if( nPart >= MAX_HUMAN_PARTS )       
" G- K8 \6 z1 f$ j' y& y                return;+ P8 M9 F; y) |5 O  G" h% ~
( A" A& T/ ]9 A& b9 f+ \6 K. V8 H
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
, o9 u! B& G9 O) _
7 ^4 N5 ?. B3 Y# `2 a) ?! N* e5 |( F6 S. W. P% t9 |
Code:
* }" e( G# r4 l* D: }1 g/ P( {7 ]#ifdef __QUGET_SWAP_FIX" v: b& J0 P1 n) h' _5 F% ]

9 Y  C# v* p& C9 _  I                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )  D, L1 R7 i/ ^4 u6 c
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
, p* Z4 I6 a. E3 Q2 f8 B) [4 U* q$ v/ o
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )$ R1 m- F/ m* e% M8 U; T
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
1 Z9 M/ [' R; n, R6 _( j; D* U  B: S. h2 F6 g6 `
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )& e) N' H! Z/ W- y  o
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
$ `& [% Y" `, x$ R& U
; p2 @# K: ~0 K  z2 ^  b* I#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
7 ]1 E4 o7 l1 F9 r) m  O& Zand add under
7 C4 P( G8 H+ i3 _$ b6 |, M, A1 d& y2 x
Code:: s8 t3 {6 Z1 @" b7 ~1 Q8 G0 b
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
6 t; j  Q7 A+ l4 g4 _3 z! f                        {
* z% x$ @+ @; A3 }5 I                                CMover::UpdateParts( pPlayer->GetSex(), pPlayer->m_dwSkinSet, pPlayer->m_dwFace, pPlayer->m_dwHairMesh, pPlayer->m_dwHeadMesh, pPlayer->m_aEquipInfo, g_WndMng.m_pWndBeautyShop->m_pModel, &pPlayer->m_Inventory );! |& O1 y) Z% ~3 f2 K% r
                        }this9 u! O; ^$ O6 w  `$ |  {

8 H6 V' r% _2 j3 d' sCode:
' K8 ]8 v* |, r4 U6 ?( n#ifdef __QUGET_SWAP_FIX, ~/ W: A  Y, Y& G8 z# b4 u+ c
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )1 C" c4 K. X8 S# j) D
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
4 Z3 j$ f( R& w- Y9 y8 C, i( {7 y$ Y
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
* b5 T" {+ Y% T  f' H                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
# k! r' ^5 H0 C/ l9 S& Q/ b! z* l" b5 [0 Q) e& }9 E  u
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() ); M, s/ c' B' `2 e# G; l" d
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );0 T( e+ i; K/ x% Y& D/ E: f
2 k( c( s6 ^/ B' |* h
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver & ?1 d9 [% Q" f
% }( I8 q; z7 l7 j3 f5 D! L
8 ]: |& Z2 E3 R) H! Q





欢迎光临 飞飞世界论坛 (http://www.ffwold.com/) Powered by Discuz! X3.2