标题: 修复交换错误 [打印本页] 作者: 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 & X2 X& _" ~5 h0 Q TI posted this because someone kinda posted a youtube thingy about it :O. * i' Y7 |9 n+ G4 s0 F1 |- B: Z& k x" c3 C
Find this in DPSrv.cpp @ worldserver$ v1 W! b4 u# @; K4 j- r
" D! U- {& X/ W: zCode:' \$ k* S* l5 d# t2 s5 D
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) * d8 D+ y2 ^ ` H# W5 n4 l% C) J ]{) @# c- |0 R3 T7 O( A+ q
DWORD nId; ( H0 z4 _5 ?8 q int nPart;' E# U. v `* I' E" U! C
6 {( ]2 s. V' L( e9 u3 O S ar >> nId;/ Z0 `% u& m! {+ ?0 s0 z$ B
ar >> nPart; 4 v. T' ]( R, p! j6 h
# A( G7 i. Z: V" a' i" c0 D
if( nPart >= MAX_HUMAN_PARTS ) 4 B. t4 C, ^& e( V0 q return;+ H2 n( I3 {) p8 v& z$ q
8 n0 I6 \* t c
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it. x( I" k+ N) M L& p8 @
9 {6 \% a. }4 G) H6 _; u
+ Z5 @, e5 f1 D if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )0 w6 A8 M0 ^$ O% }+ B
pUser->SetHitPoint( pUser->GetMaxHitPoint()); 0 _0 f7 m- ~7 u- o! P3 W# r$ L' u5 I) r+ K# q; M" ~
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )5 A$ u* v# A/ g5 W0 {1 ^5 w$ Z3 G
pUser->SetManaPoint( pUser->GetMaxManaPoint() );2 O% F [" L6 g/ U
* ~! ?6 h: L5 Q+ J. F8 |. x
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )' B6 h, ? g0 n9 s2 Z" Q" E
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );4 t' q" b4 P5 J1 T
+ t( r* P" K1 V- P( P8 V* m; I#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp. ^$ d* N4 T3 z, [
and add under& E, S8 A& {- ]2 g) B% i8 q, Y
. Z# ~: A& `( Z; ]! ?; aCode:! X- Y. r* @+ J2 K3 o
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ) # {/ v% y, ?$ k7 j7 n$ Y { $ N: s! v9 `3 x0 i h# F) 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 );( y% M# Q+ m! X* p6 r4 s# A' |( ]. v
}this * ^: ?/ O4 u4 j* S4 n; g: h# `0 S+ I- A9 T M8 t/ K/ }
Code: : D$ n6 E. F1 m/ T7 @3 J7 t#ifdef __QUGET_SWAP_FIX0 t, g9 j' A* d# `6 ^" p6 [0 Y
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )6 q* E. O( L) X/ }; G( h
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); 9 Y* J% [8 i8 h B7 J% D " H2 w+ @+ s' z7 x- [* K* Z if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) & L( ]8 ]$ b7 [+ j. s2 w# [5 R pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );% \, a' |# a, h+ ?) v! m0 h9 Y7 |( |) W
2 ~$ g" o: g* B$ Q! x/ a5 {* ]8 ^1 |
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )# M6 S. B6 F J# o J9 a$ _
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); . ~6 F$ d0 u g h' L5 ? _9 p7 X . H/ H! h b2 u; E8 B#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver / F0 ?; e; z' H* S6 p# t% d