飞飞世界论坛

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

作者: 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 0 G4 Y& s5 V/ p' k* q0 k9 e8 J( P
I posted this because someone kinda posted a youtube thingy about it :O.2 ^! v4 L8 \& n8 G, k

. O6 {$ `& v4 g' P4 iFind this in DPSrv.cpp @ worldserver
" ?/ S, v% a# M/ r
4 h: H8 @/ [( P% @5 qCode:
. E$ Q- w- q3 \) A4 evoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )- q  r' \: |& i) f
{
0 o# f" M( v( y        DWORD nId;3 \' ^+ W. B! r& }
        int nPart;
" v- h8 v$ R7 G" ~- w; U; B+ r7 s, S0 Q  T5 \) E4 O: ~: B. H0 G
        ar >> nId;+ @  e( U3 y9 M# W. ?1 _
        ar >> nPart;                0 z% D5 ?; ]0 A
       
3 O: _( \8 P/ @) K8 U. T* T        if( nPart >= MAX_HUMAN_PARTS )        9 J- v& [: b* U
                return;3 p. E* g9 X' J7 ?7 W7 [
* f' o# g' j, @4 V) m" V7 r" F  T
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it+ G; k9 x/ I# d+ Z# g* j% H
  n# R' Y, n: U4 M1 ?
2 O6 X  c$ N/ I3 D$ ?; t
Code:$ Z; C" r  _, n. {( J% U9 F
#ifdef __QUGET_SWAP_FIX
% x! ]# ~" P% `! n# Y9 @
) m* X  o( [: |4 X$ s                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() ); t) B; ~! h# `1 Z4 y, D1 E
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());7 d0 u0 a% z/ F' h' l) D

9 F5 Q; n! j0 c0 l6 |                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )6 w! h; S" y4 F: [& w! W% ~
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
8 ~/ x  Y1 O! D3 r* t( @+ ?/ a3 d& q* k% U& c2 E; ]
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
" Y* L. }+ ]; S( l                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
% c6 w6 {! S, L* A. Q+ A" R7 P$ i/ L+ w
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp/ [# y1 u6 N5 X+ o+ X! @# {
and add under
8 c; g! @+ |" H9 Z7 H$ f0 n3 ~) K% d2 e( r4 d2 o. c/ [
Code:# Z" F! @3 @: v
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )" j* P: ^. v4 _& _# D& _
                        {
. _. E' Z% T! M. @                                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 );, ~7 U% Q! O- w) A. k) O7 x
                        }this* R. K4 y0 N: O5 i6 U0 _, E0 f  P
: s8 \4 U8 z6 f; w
Code:
; A. d, N9 C' |6 d) X; B#ifdef __QUGET_SWAP_FIX
4 t9 y" R2 J# ^5 d8 o                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )# g3 r! `: s. B' K3 l
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());2 [# r6 E6 w2 C; j2 P, J
2 H8 D% j" v; a
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
* p* ?7 T- c0 }9 t, A- `3 j9 b" c% n                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );  f# \1 a# E& t" N+ [5 I, w; x& }
' ~# y, |$ a% J- w" g
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )' E1 p9 ^- [# i& N5 @: Q
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
2 i. h$ R2 }9 o5 E" z1 m" P
- K" D; d6 S1 y5 A#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
0 x5 H: s& t9 P' P5 r9 v9 u' E. \& g
* Q% t0 s9 K- G! f: _0 w4 N





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