标题: 修复交换错误 [打印本页] 作者: 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 . U* A! |$ E& lI posted this because someone kinda posted a youtube thingy about it :O. ' K7 e( p; S) ]6 O) O0 }: x' V% B- m/ x5 e
Find this in DPSrv.cpp @ worldserver0 P( e# W3 K U
. ^5 N2 M C3 K" b4 x3 \! q5 e' }
Code:! P# k! A9 R" D1 k/ I) \. ?5 b! y
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )2 o, L. l9 v# B8 l, s
{ 2 R1 N T( N8 u* ` S* y DWORD nId; 4 M7 }! ?1 A) n# a! a6 k/ F int nPart; ) k/ ?9 d3 g! G7 F' Z6 r9 e: F+ D. G7 M* _* J, v$ q7 y8 Q
ar >> nId; 8 q/ \% u, N4 V( k# }( N' f ar >> nPart; / v: s' M- I0 L; F* B" }
9 \# }+ p4 N$ g
if( nPart >= MAX_HUMAN_PARTS ) # X9 v' K# t/ H return; 3 s9 b; r+ i! \5 x : z' {# Q% O) d" E' A CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it. t3 a+ x2 ^! f
) q, W G& v0 I. u7 H4 C3 I8 T% B3 z ( l, I% X9 V. s- d7 y$ ACode:- G) b6 ]) J- K- \9 e
#ifdef __QUGET_SWAP_FIX 5 I. Q* y+ q( ]: N7 E, _, R6 g0 ~0 K# z, b7 M2 S( {! d
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 8 n! _& z+ b4 F4 t2 ` pUser->SetHitPoint( pUser->GetMaxHitPoint());! s, J5 R5 P4 q' ^ i( A0 U" R
- a( O4 S6 O. R& W. v1 j- R, S& I1 U
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) 5 J# G: {+ @# g( p' k pUser->SetManaPoint( pUser->GetMaxManaPoint() ); % D2 [0 i+ i7 b$ X ) B7 T/ O4 v+ ~7 F% P$ N) V5 Q& N) m if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) 6 B9 t& ]" f9 S. l/ G4 z) ?2 E8 v pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );1 C4 \$ l6 s+ ^5 b# }
8 W' ?8 F5 C4 g) o. n7 h& J
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp $ x9 p, l* ]' N8 {7 {+ xand add under( G9 D( ?1 w/ X, a8 Z
! s" n8 `. `) J* H
Code:5 C9 f/ B9 N! X
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ) ' M: h2 h1 h1 o! d5 M) p {! p w6 p( |8 d
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 );3 q' L7 S3 s7 X3 w+ g. g% V
}this 9 I" A) I( k+ ~5 P! T1 |: |- T/ [( E
Code: \+ ~# }- I! S
#ifdef __QUGET_SWAP_FIX ; p+ {) K/ E. L- T2 w5 |7 g1 q if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )+ o4 P' Q: H m! E' |
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); ! ?9 h; w1 t, V0 j2 u8 i$ n" W4 R( ^% ] # ]" m6 t6 L" L" ~7 }! v1 C8 I if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )# B1 c: E" q$ D5 \# k P# i/ |- a' k
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); " i; P0 L- H) u. P# }( G4 q5 Q9 [* m" V
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) ! X1 K2 m% B; {. j( M7 I5 Q& j pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); , u- L- F2 k. H# y% u" F8 ?3 X* N( r# m1 H* f2 G
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver 9 I9 g! a! D8 p9 h9 i2 L( _( `# Y( a8 B+ ]6 B
! P6 D: s% u: G& p. k