飞飞世界论坛

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

作者: 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 # V& c1 [) X$ c- P& C2 I+ s; ~  @$ D" p
I posted this because someone kinda posted a youtube thingy about it :O.
3 G1 D. c2 e0 q2 n' X8 T
2 p8 f/ g3 d6 v  Z6 ^& DFind this in DPSrv.cpp @ worldserver6 M6 Z; L' ]7 K: V% x- i" b

3 M! W, g# G/ y6 O+ rCode:
# u3 H: W: I" N! q/ b$ Lvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
. x5 a( w8 l3 y. ^! ^{% A1 t" u7 j7 q0 x- D
        DWORD nId;
0 Q* J- c3 K3 O) R; o0 {/ y        int nPart;2 s5 W0 X( B' t' Q

# q$ e  _. U! R8 o# Z( q        ar >> nId;
2 e: i% f- v' b9 D& T6 K7 ~7 c        ar >> nPart;               
# q& q8 V. n' |/ O. G+ r       
1 x' P& H: Z: G        if( nPart >= MAX_HUMAN_PARTS )        % t, M2 @8 q. U( X$ j( h# ]
                return;
7 G2 q9 `& S1 g3 p  _& `, k0 W: X3 D; h4 R- N$ l  Q; b1 J$ z
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it0 }* y3 W/ X3 c8 V& u$ ^# W
; y- [  U4 v/ }9 v5 T

7 ?( M* X9 v1 N; ?0 HCode:
* n, b5 ^8 Q! T  [# R) ^9 v! y4 t. a#ifdef __QUGET_SWAP_FIX
/ c# {* S9 n: D3 A, q
4 |- A4 J) k1 W' o                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
" ~0 e0 Q6 W6 ~% U; C" D* E8 x                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());- d% b! i. ]# G3 U! v

  `% _* o- p* q! u, s                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
, {$ }$ e/ n2 o2 e0 V" q                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
( d' e/ y& P/ A: u
7 c- C2 R0 _" \% A0 G& u+ x                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
/ [0 L' W. B0 b) A                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );5 G- V5 I! d+ ?6 \  R

' z3 b+ c$ r& @. u" H5 r#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp; {" v! e1 Z- H' J% o0 h
and add under
; o0 C1 z8 K( K  |; R2 S
5 O2 F" F# R( N9 v- [Code:# g( s2 C! k0 W+ w, o
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
9 Z) Q: G& l8 o- z4 S( F                        {+ a5 D! i; T; n" ]0 m, B
                                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 );1 }4 k7 P3 e  b* Z+ b
                        }this
  O! Q& V5 {) Y5 M+ f) O# `
2 X8 d  R1 F  f' M1 V8 pCode:
2 ~* ^4 L$ L' Q: p- a+ b#ifdef __QUGET_SWAP_FIX* o8 t7 z) C8 @6 Z! j
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
5 z6 e0 k8 j3 x4 b" D) S3 `$ e                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());7 T  P, w6 X# C6 f$ S1 `

" U4 [5 V) S( e, Z& Q! Q                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
( {% r0 Z/ Q5 a! x' R) j; J                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );3 K9 r! O' z9 g: n

+ K0 |8 l1 h% r9 o                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )3 A$ w. r4 K: n' S1 v7 l/ z
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );# q& m$ |) E, R0 ^7 K8 T
1 M* g) h/ H0 ~0 a  M% d1 }+ c
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
: r; }  ~& _6 X, s1 _) j- m5 _9 s4 {3 [1 R$ H6 P( X
' ~' Z% ~4 S/ A) Y2 f





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