标题: 修复交换错误 [打印本页] 作者: 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 8 E Q; V1 U( X+ PI posted this because someone kinda posted a youtube thingy about it :O.+ S% _" q+ U( }# v; [& v
/ m: C" D+ T5 l* [
Find this in DPSrv.cpp @ worldserver5 g3 I( a6 G7 b; d
4 @* g1 R% ^7 ]6 W5 L- Z5 NCode:2 X. Z9 l; F8 f' ~) }* {; m7 s
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )) W- ^( M S8 |% U( J, c' ?
{. ^! Y$ g" D: j* m6 Z9 H* `
DWORD nId; + |$ |% v9 {3 w) K9 G2 p9 O* c int nPart;2 a9 U( i7 X4 L1 @+ e( i8 e
0 G6 O, C& j! b4 b
ar >> nId;% W. y$ q( D: ~
ar >> nPart; 5 Q Z9 k5 N- I V; a {1 @) K( l& ~6 N) O" S if( nPart >= MAX_HUMAN_PARTS ) * ^+ U& |" s# |# [' g N5 a, t2 N
return; ! p. Q' X+ h8 f2 J% @: x& V N3 i! K9 @/ s# w6 T
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it : O: t4 x1 ]5 E' @1 I3 f' I: J# |, T2 j
3 ]: |6 n! `$ q! V' c
Code: ' n2 c( N5 K& ` H: T#ifdef __QUGET_SWAP_FIX ; e2 C4 k6 X4 L; F3 _ R " Z1 P7 a4 ?9 L: q if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ), z9 L( k. V+ g$ r$ F' L5 w. \
pUser->SetHitPoint( pUser->GetMaxHitPoint()); ; O6 U9 a0 Y/ r2 ? D# \+ S$ T7 y0 P
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )' s* C2 Y, L, s9 V" i7 k
pUser->SetManaPoint( pUser->GetMaxManaPoint() );, w3 W/ X& I+ B% `3 p
9 d) O6 h5 {2 e
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) + r0 Z$ N$ E/ D0 S( n- K% c pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );7 [% b* Y0 o: T/ E2 E( T
* k2 L8 A! m g( b6 D7 [3 o, O#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp t B0 s- c W; D4 A' Z% ?; U2 ]and add under 7 Q/ W, v5 @4 C& @1 D 0 y+ u8 m8 d& D" pCode:1 w8 w. H m0 C7 }6 z
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )8 f) @; @$ Y* ~0 V4 g' W! \
{3 c) W% u k7 z( @# |
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 );7 V( V" q& s# j& I$ I I; t
}this , `( \) v5 D" ` + C I q1 f9 I$ f. b# tCode:! E! W6 a$ k* H; q8 {
#ifdef __QUGET_SWAP_FIX5 P1 b) \% H7 _* `* U
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )) c! T9 r5 t' h
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); ! l4 C3 i( a m% @" Q( E @. {$ H. P: V
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ), I" d2 S' G( z5 A# K
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); ! F W* K& _. @2 a : |( V8 B( |1 F5 G' d: \ if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) 9 P$ j% r2 ?) u pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); - z% G# _. D$ S1 W& Q& r0 g" K3 ^( x# ?2 J
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver - H# \# c# l: @" \: H* { + P( `' Z) J. Q) a1 Q0 C ( W% i, n. N" ?! ^ |: ~