标题: 修复交换错误 [打印本页] 作者: 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 , L- y6 x( T7 q2 WI posted this because someone kinda posted a youtube thingy about it :O.. F. W# r; k& a4 t1 }- h% |1 g
7 _) N/ } [5 t( c* Y
Find this in DPSrv.cpp @ worldserver) j! P) m7 I \/ W
. L# K. U& l( \3 j% ~Code: 6 \2 @ p; v0 O# W6 g( Evoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ); n6 X! f7 r+ N1 O' Y0 K* P3 s
{6 q1 l4 a. z6 \9 x$ j
DWORD nId; 7 Y5 T% y) K2 |. b int nPart; 3 W6 c9 H( V7 x; i" k # D; p- b4 A8 ~, S5 Z% W0 [1 ? ar >> nId;% H5 @) }% s# u- b1 S& g
ar >> nPart; $ N9 _- K2 K3 L) @( e! d3 e* v
" @: j7 k! G; v2 a5 F
if( nPart >= MAX_HUMAN_PARTS ) & [: |' i x1 V0 u7 r return;2 X" S' w. W% y. w" t
* Q' A- s+ F# i; c) T$ E9 j) y& c CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it+ s6 P9 l/ x s3 _; e, j
) G+ V2 T- y1 F/ r# E) j$ Z
: q: N6 e5 N5 ?) p# K1 p; J
Code:7 ~. j+ p3 B _3 {5 v
#ifdef __QUGET_SWAP_FIX ! N/ J- m! n6 N2 x : s( ^7 f1 p' p& T& X if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) & ?5 T% [' _7 a: E$ p1 A9 y pUser->SetHitPoint( pUser->GetMaxHitPoint()); 7 k, l2 C; O4 m+ p; V. e8 C, f( m5 B
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) . @8 B h- r1 t' m pUser->SetManaPoint( pUser->GetMaxManaPoint() );) t- l4 s4 ~ u. c
& t1 l- u$ P- n* ]! ~$ w) }& A if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) & z" Y% f8 z; |) e" T. b; l' n B pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); 4 U$ G$ g) ]2 K5 A' \! o - k, z/ ]! O. t/ y#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp- r8 f) }+ r3 J4 A5 U
and add under1 t& Y. x: U, J& ?7 {. g
' a( K9 k, U9 w6 m
Code:" O3 o% s# H& N V6 r
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ) O, a6 W" M8 l' G
{ ' W6 j8 w, {. p6 I! |% W; G$ Y 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 ); 4 f9 j5 Q. u$ d4 ~ }this ; x1 i0 C+ b3 u8 `9 d2 E% O$ }9 f
Code:$ h. G: z/ }; [+ a( G
#ifdef __QUGET_SWAP_FIX: U0 B/ a0 }+ l* b3 ]
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) : {+ c1 C9 n( O } j) p pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());1 n6 w& a) y/ _" I3 w3 o
' P# g5 o+ M5 E9 q6 ^3 P4 t
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) ' {: d: l" R7 a; [, ] pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );- k% d2 m g: G) I2 r7 Y! H1 Z
% v2 _, _) c5 N; Z7 i if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) . j5 J+ s" w& M6 }- W! k' \ pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); ! T6 p, U; C4 w a 5 F! w; L6 T& k" L#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver & a2 E5 P% Z, A3 }9 n. L5 g( {