标题: 修复交换错误 [打印本页] 作者: 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 6 u& R2 g& X$ s! C. J4 e7 A; ?I posted this because someone kinda posted a youtube thingy about it :O. : j2 @* y- J) a: K8 p7 m* v ( N: l7 c8 S8 U" UFind this in DPSrv.cpp @ worldserver( W ^& n7 X3 N3 w# J+ s
' h! ?6 V/ I, K8 t8 GCode:5 o& I2 T3 @- l; K" |/ `) y
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) 7 h" B# B- h+ k2 ]* b0 _5 W3 ]& y{ 2 B# }( {$ E, S7 W DWORD nId; 8 y5 \6 ^. `$ t7 w9 L# n( w( l, ] int nPart;% F, H. q$ Q) \" V5 B$ C/ B# Q% o
6 R$ m* \" W' [' A- }8 q
ar >> nId;1 \" I3 b; z# b# v% F* y0 E# c+ ^, _
ar >> nPart; / H+ v( M/ S; k. j1 Z5 }- ?- T 3 X% H. A) Y. w1 f$ R: M; v, ^
if( nPart >= MAX_HUMAN_PARTS ) $ F+ U5 f! E2 _4 L. L. K9 c: _/ j
return; : Z: a* y3 ]0 ]/ q9 X& p 2 E0 c7 r5 z1 ]$ e% u; f5 O+ K g, i) [ CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it $ _. M/ D3 j: \ 1 K x8 i/ h7 |+ }! o1 j6 P ( G0 S! I) e+ M3 i# QCode: ' ^1 s# F; y: y# F, r#ifdef __QUGET_SWAP_FIX 2 ~+ ^) u0 [/ V7 i" f7 y. y7 O0 Y5 h4 t7 P8 b
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ), @3 f1 D3 K7 h, Z0 @% T
pUser->SetHitPoint( pUser->GetMaxHitPoint());+ }) V$ y, i" Z& A: ]6 ]) R! g/ b
4 C7 a" ?3 ~9 K- `/ X if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) - r0 J& _/ {9 B; e1 N pUser->SetManaPoint( pUser->GetMaxManaPoint() );5 @( a! q5 V9 T
' j. C. o3 m+ b
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ). d6 D- D' T8 y9 T
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );/ O. V0 N! b+ }) T
4 E8 T1 {6 J+ Z$ A8 S" _#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp ! G! r# ?2 O4 m8 m8 {1 _and add under / r. \5 \2 j: S0 v * f! d, Z6 X4 ?4 x/ @0 {0 p3 wCode:7 |% r! ?: |* i; L
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ) ) c2 T6 G9 s% a# y* ^) Z; U/ v5 i { & D4 \* o7 ^5 w 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 ); 2 O! O2 T: h6 W2 _% ]; F0 P }this $ I+ k. @1 U( O+ D- L8 d! v7 w% K4 U4 g
Code:8 j/ j) ^+ m# q, c9 J: q! y7 l
#ifdef __QUGET_SWAP_FIX# G' s7 B* t8 Q0 ?
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )* j- b" \& O2 @2 k
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());9 G: b4 a- i+ ~" W3 i
. Q5 {0 [ p9 k1 `( c2 C1 K% ?
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )8 g3 p2 C7 D, G9 V2 W
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); - P, G; G/ _% v7 K7 F3 }! Z2 O* x % }. @; [. U8 G# K if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) : w( @( C& D4 D1 c: B: P% G" C pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); - C6 ^1 V8 h) i 6 O5 L* k& G: b( @6 Y#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver ) r/ i3 Q2 E. h3 f
- u6 e) G: D! W
$ Z7 P& B, x" a4 A, K# V