飞飞世界论坛

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

作者: 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
# m4 a; Y  K1 N5 P; sI posted this because someone kinda posted a youtube thingy about it :O.
1 V/ ~  N6 z% W
4 v  A8 w3 p* L7 y* q* G. jFind this in DPSrv.cpp @ worldserver
0 Z/ ], v* {9 _
/ |2 @( O6 U! `, \Code:
2 }$ }" i- j5 s  M- ~void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ); Z8 f$ P8 T( t+ @7 ]) `
{
& g! L: K  x9 x; [        DWORD nId;- @2 t3 T/ m( c6 x/ |# ?; w) m) v
        int nPart;/ [3 k) E( t8 n2 F" D, v9 n

: X& o8 v3 D1 x, t. N: G        ar >> nId;3 g, }$ f/ J( C' H& b2 P
        ar >> nPart;                ; |7 N( ^- C) ~, W: m
       
( I2 w5 ~& u4 m+ b2 [: ?        if( nPart >= MAX_HUMAN_PARTS )       
* S0 f0 L% j8 Z5 Y" @* K: i/ p                return;- K& q9 N; e5 c, D" o

. G6 w" r" E* j( T* k        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
7 c4 L! x- W$ F" t7 i  W3 V
" T1 V$ k, `% G2 @
4 Y5 [% O* x( J- @: A0 w$ s4 b9 _Code:6 A7 m2 m1 T2 n% {" o
#ifdef __QUGET_SWAP_FIX0 ]0 F) A$ u  B- }- p) h0 j+ m

  F5 y* n& v7 J5 G                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )4 l* j2 e* s1 ^0 n+ s1 @4 R
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());& f4 p. ]/ T' q- C% V- i- C9 u

& U( \. [2 a$ h1 l+ i5 |                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )5 h8 ]9 j: C3 Y0 g& j- a% Q+ B$ K
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );. u- X# k5 M. Z+ b1 G/ g2 z+ [
7 U1 X9 N- m7 [" ?! I
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
6 s; I( |7 _* Q9 a8 i4 g: U5 N                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );, P8 C/ Q1 x. \2 B; O; m4 P& I
* `2 t; ]; x% \9 S9 ~! X
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp; b0 G; {, c/ q7 y4 f" U4 J6 \
and add under
4 q6 I% }+ [; k, t" j/ N" ^
9 h  c/ t7 ]  ^Code:
) B3 o0 R  X  b; z) ?; y% iif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ): o) q4 D6 P0 Y& h! v
                        {
+ {1 N8 q1 l$ I3 f                                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 );5 Z8 m& D% k& o$ w. i& A; k7 t
                        }this
" i6 u- C. w4 F8 |9 K% R  _+ s" `0 b2 S5 p
Code:3 f) L' N! \* N0 `3 a9 b# H& D
#ifdef __QUGET_SWAP_FIX
3 Q* r5 t1 h. j6 E1 M& }$ ]1 F2 I                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
5 }+ _! {' }% W! D                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
$ C1 D; ^6 H0 }6 e. i. g
6 F3 P" U' C( i6 @' B  q4 Z                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )# x, R# |7 p# \2 B+ F5 P
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );/ F" M& L7 D8 }; b1 `5 C7 K

# q- H8 {: q7 O7 [                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )0 Q+ E1 s: c  B. _0 f8 C
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );& ~" S3 ?4 M2 f0 h( C4 n

% y, r- E, `: a1 v#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
! \+ ^# o( V( c1 @' y1 ?; n+ P; L1 }8 q, r; y# [) ]3 j
2 a8 @+ m) E) M8 O7 z





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