标题: 修复交换错误 [打印本页] 作者: 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 w0 B0 f( o6 p& w4 v7 o
I posted this because someone kinda posted a youtube thingy about it :O. $ ?4 f. B) T, I* ?/ y$ a+ b4 c! w- o& E, [. E+ Q# m5 m
Find this in DPSrv.cpp @ worldserver# h i# V% h. n3 n
3 v. b* T; J+ R3 b) Q0 H# ]# lCode: * i: L$ r& K! B8 Q0 `) @1 w: Gvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) % v& R" ]; z( ?1 m4 l{1 U& h1 K0 ?( }
DWORD nId; ( j/ Z( U0 A8 Z. k3 P8 H int nPart;) T/ R9 |" X7 L% ]7 G8 C; R
; A7 u& z$ z0 s$ ]
ar >> nId; ' S& W, O" R- x4 w# n2 s- i% Z+ h ar >> nPart; & }+ S" I/ H/ E3 P
( |. L1 R, N2 @) S; V if( nPart >= MAX_HUMAN_PARTS ) 9 f7 }' {' W! U+ ^& }4 L( A3 ~3 t return;5 \3 O+ J9 }+ S3 s
9 s* O. g! M) g4 e( w
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it& B2 d1 [" o0 l- a4 N- l4 a
5 w0 s7 D! u6 t( \% x1 H5 D U8 [# E
Code:" \5 E; ~: Q; Z ?
#ifdef __QUGET_SWAP_FIX : v9 B) T* J# m/ v; U/ p v- ]( I8 y& k$ I* C
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 1 Z- U' ]5 y2 B x8 \1 F% C pUser->SetHitPoint( pUser->GetMaxHitPoint());* C1 L( W# V9 f$ g/ E
& Q' ^9 C+ X4 z1 l* o- V; I if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) 4 c) m9 v S) J0 A pUser->SetManaPoint( pUser->GetMaxManaPoint() );/ U/ l/ G2 \8 x5 M" M$ O
& r& f7 F8 L3 r2 w- ] if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )$ |- Q, t) \/ A7 U
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); ! S. h1 `$ W [- L$ G5 q7 f! ]- ]1 k* R6 Q# S( X. L
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp3 Y" O2 H1 ^ J# p
and add under6 D5 g4 r& F- i3 L# }! h |- w5 k
5 G/ Q0 d) i) h7 f* j* ?Code: + O& t" I! O$ a3 pif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )% k/ L' t2 U5 ]) u' q1 z, _
{ - p( W6 @. s8 B$ G s' 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 );" v0 O% U- s+ D x
}this% W5 `6 C8 W" R" ~; D# ~
' I; K$ y R- N
Code: # H1 N' e4 C S& _#ifdef __QUGET_SWAP_FIX/ J N& \, m$ G( T4 l4 C2 b
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )& o+ ]; |- U; ~ E* m, _3 o" _
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); 2 N0 J3 F1 h/ a% U$ v1 R0 u9 ?1 A/ \: @& L1 A3 Z1 O! |- ^
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) 9 {8 E" w/ ^" f; m5 f pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );+ v3 A6 c! u4 Q+ N8 h& G) e% h
; L( i8 d4 R( j! Z
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) 2 k9 P2 J' x$ z9 G pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); ( Q9 A- T, x7 D4 w , Y0 v. a7 g' l$ ~#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver & |; F/ x: Y* |# V9 G, |
' j* G7 R( r. Z# n& n