标题: 修复交换错误 [打印本页] 作者: 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 ^& M; }9 O$ m/ r# D# s
I posted this because someone kinda posted a youtube thingy about it :O.( [8 [9 B( J. N9 |$ w
! j" G: v- |$ G5 ` g5 Q
Find this in DPSrv.cpp @ worldserver 4 ]( h2 X) c* b" m* s+ H ) w! Z4 ?$ L7 f yCode:2 i2 A- G+ l6 \+ g+ F3 X9 {
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) - g3 A3 d' D7 a5 _2 k{" K, |- K7 r* p3 E" b7 g
DWORD nId; + O# }5 H% {4 G' K int nPart; 7 ]8 m; j* B x" O8 c% M# v& K* X, \ 5 Y: o3 ?) ?% f( m1 T ar >> nId;+ `& F4 t! k8 i; v
ar >> nPart; # U( F) N/ C2 Z: ^& G A
5 J8 S7 k* o/ X
if( nPart >= MAX_HUMAN_PARTS ) ( M# N1 a2 Y& Q return;+ O* [6 d0 e2 R% n, \6 E5 P
9 R! g* d! i. ^+ T m" [) S CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it 0 B$ e: F2 E- V3 d1 \8 H+ b2 c: w
4 n0 b8 M) y$ u8 z, C) v; LCode: 9 W, J4 |! D/ @6 `; n#ifdef __QUGET_SWAP_FIX 4 }' ~" E/ s: U9 g7 Z: @" P& l* l0 l
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) / T' i- I }8 r6 Z8 u pUser->SetHitPoint( pUser->GetMaxHitPoint());! p1 X! c# ^$ E/ F3 `* g1 F
: ^2 Z7 z# [2 _ g& U
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) ) K, o' g- j& I$ Y, C8 Y. I# q" r* r pUser->SetManaPoint( pUser->GetMaxManaPoint() ); # Y9 @" R. `1 J- k) b1 e # J1 q4 ]' w6 \ V y0 s if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )7 M/ O6 M; m. x6 ^! f$ Z% J4 \! m6 `
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); ' s& }8 s1 P1 V 0 u$ F$ q5 }2 ?& I. U1 U6 k# Z#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp / F7 A- t& H0 H6 s1 x) Eand add under! i/ {+ a3 V# S6 h
3 ^7 D9 j, _5 I; }1 o. tCode: * T1 I1 ^& r kif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ); [+ n3 N$ K* X. x
{ 8 ?& p9 a; U3 a. C" y$ M2 |) K 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 );+ _) n$ s3 n+ @& a6 r
}this0 q' ?' @: j- N2 V
* F' [6 j+ M% `# [2 c
Code: # x" C; u( A' a0 K+ r* q, ?#ifdef __QUGET_SWAP_FIX1 r5 }: y, d( R) c8 d9 _/ |
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )/ p. N: g; X( \
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());* V) I2 ]7 N0 G, u& C, E1 A+ r
+ M# v$ Z/ a% h
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) 6 O$ r" S! x' y& N; h/ z4 { pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); - W; Q% V. N- s& e8 u1 L 6 L! T/ |# {. n( r2 s3 V if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )5 F: }9 Y' } { U$ f
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );& w/ a9 w/ [+ p8 g: K: x
2 D [+ Q4 S0 \4 s
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver 5 E/ J2 {+ b: H/ p3 T$ V- B , R: N8 N# l& S* E/ O2 b& ~6 @. i& y- @& a/ |