标题: 修复交换错误 [打印本页] 作者: 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 : K. J( J: z" A/ O v+ Y
I posted this because someone kinda posted a youtube thingy about it :O.9 e- q, B& [* j
8 T Y- U" d5 eFind this in DPSrv.cpp @ worldserver % x, Y/ `9 m3 q! z* d p- v6 {9 @3 W: Y4 R& j( a
Code: |& \ @; t5 }9 Fvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )5 {" N" Z4 [: c! f
{ - \0 z' ^" Z- f& Y, C DWORD nId; & s$ T8 A: X4 L/ k, D$ g. M# U int nPart; * z! k! M. @4 a7 k9 I8 Q! W : H+ B1 ]* r! L' C ar >> nId;5 J7 w% g1 B G
ar >> nPart; : O: D5 E) `0 t. l q; ?
" _; S. A" J: z2 {
if( nPart >= MAX_HUMAN_PARTS ) 5 W. p- k( B& ]8 m4 S: D; [; g- J
return;4 K1 E- o" P7 G9 O% o' G8 k# B; V
7 M0 ]: X, h8 T6 S( A
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it " j- b- b0 i4 F& c& [7 Q7 D) i9 Y& Z+ G: T$ K8 m$ k
6 G4 U) S: G+ G( ?, xCode:- r. L1 P' y V2 c; |
#ifdef __QUGET_SWAP_FIX * Z- W4 ^) n! d! ^- R8 ]+ w2 k" l! q8 U1 X5 i: R0 G
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 2 M1 y3 J+ O$ S w" ^% i6 H1 i pUser->SetHitPoint( pUser->GetMaxHitPoint());: f: N& T! @0 J0 P$ Y e7 H X
5 z' |) {$ ~( t6 Y% U
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )5 |3 L( r: Y* H1 ]$ L) T
pUser->SetManaPoint( pUser->GetMaxManaPoint() );% P! M7 ?( T( b& S7 U
2 D3 F" r- y) j
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ). C G7 X" J% F P$ C9 M
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );) T1 R+ f& e) R( \( Q! E; I
; X6 U9 Z4 N, ^. d8 p3 f& C. O
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp; W0 i, O" O+ G8 \
and add under$ V% f* L7 t+ Z; R
! ~" b N0 _0 i+ i) YCode:5 E5 B+ ~5 S, M I5 D) y
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ) $ Q4 X& Q! N( f {# }: f V( @+ I; G
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 ); 9 R% `3 q. t W! B' O% j1 o }this ( j5 A( ?% e5 c' Z3 w % w2 m8 s/ F! @Code: ( g, @( ~: y: V) P: g5 [* C% p3 H#ifdef __QUGET_SWAP_FIX 5 T, k9 b2 X3 |/ E0 U3 @- C if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )4 I! d( z, U$ I0 \
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); 8 @ W7 W/ Y V I2 E5 z H! u# } if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )2 |! u! y4 Z1 ~* s$ _
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); 7 j# x/ r( z, p+ i0 v - a, d9 X! g( x3 e if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) " s% I7 w/ O) Q pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );- L7 X2 G+ j5 h1 P
6 t; K) s% P; p) m+ V0 \/ R4 o* ^#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver / N. e' ]$ Z# k3 ]- C $ T1 } r) n: \8 n. x& A$ }0 Y# D9 K