标题: 修复交换错误 [打印本页] 作者: 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 # y; ]/ J( I$ t# H6 |1 J+ `! ^I posted this because someone kinda posted a youtube thingy about it :O. * U# l" U+ _/ J7 Q4 {' u9 n% T* T: [. P. Y p- f, o
Find this in DPSrv.cpp @ worldserver$ u H. G+ s+ Z
( ], [+ t: i: l O; N' c
Code: : Z1 M' C* E# E; Z5 Evoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )2 l" _* E! [/ Y" U1 x
{ . @; S9 H' `+ _4 @0 C& @ DWORD nId; 4 D* u6 {. B$ ~& o7 d/ C# D) t4 _ int nPart;# V3 F; E! h! ^, T6 ]
0 l# E% F/ Z! d' S ar >> nId;% F* T# R3 e9 `. o( q; r% t
ar >> nPart; ! F+ t6 C [* t! N
% o! k0 O3 @' O" ^# x) F if( nPart >= MAX_HUMAN_PARTS ) ) e( }$ s% X* h! c' X
return;9 g0 h3 z4 t: Z7 x
, K$ ?1 D5 N0 m
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it) P3 v9 D7 \) X8 I
D# I% o6 H5 Q' s: i 3 U% f. y' q' v, w VCode:, N7 @2 b r, v$ `( N0 h+ y( j
#ifdef __QUGET_SWAP_FIX : m5 f3 M: w) z; @ }( |* G y5 ? E% c5 }4 J# x! @* ^
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 5 q, o/ M! }# d8 d! T# i* y pUser->SetHitPoint( pUser->GetMaxHitPoint()); : D6 k) I5 F+ A5 S& i/ e 2 H' o7 t, d. m8 o if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )( `% u q' ?# o! f H5 ~* W
pUser->SetManaPoint( pUser->GetMaxManaPoint() );" s# Q$ u. i9 j5 d' I- f8 ]
8 \0 x- C- D9 q/ R if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) * S$ {0 x/ S( X* b$ T) a; a9 c; V- m pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); : o( u; D+ Q+ X" _ ' d, }9 l6 P0 i/ D#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp( [. G: w# s3 n' O% d9 ~+ c
and add under ) X7 m6 c' w& g: z. X 2 g2 O7 V# s% E% U# ^3 V) ]Code: & f0 A4 X3 u/ y8 B7 N" Kif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )# R8 D T0 G5 [7 [4 R- ?
{ ' m* J+ r4 l9 G+ s 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 ); * t( ^1 Z& P! h3 A# M# ?9 z }this 2 T0 }/ h- u8 L ! ~# r; d6 m, J: uCode:8 O+ ]2 d/ ]+ _8 m' z+ W; L
#ifdef __QUGET_SWAP_FIX ; Y" s0 }2 O8 k% g6 B- c6 @ if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ): m* p+ ^6 |5 T, C
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); W4 c2 P7 K1 h& x3 v5 L
: t/ \& R1 i5 Z+ n
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) 6 r, c, x( U6 e. y+ L/ ` pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );9 C: ?( r/ x+ b6 B
7 P( j: E2 L5 H, F8 _ if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) 9 u. c; e& B% e' v pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); # f2 q, `# ~# t! D7 |& r2 M* W p8 c/ a
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver ) F, o( Y8 r" {! m7 l% x ; }- |$ W$ |# L$ g& t' Y" R! h7 G( K2 c' K