标题: 修复交换错误 [打印本页] 作者: 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 + \$ y9 F" ^4 R _
I posted this because someone kinda posted a youtube thingy about it :O.7 A) e" t4 Z+ s2 z( M8 c% ` U% q
! h% e0 C F ?0 V
Find this in DPSrv.cpp @ worldserver, j- N/ n4 B% {0 q" e
+ \1 I1 L; _! F' X# h
Code:% y6 D" L# r4 J' {6 o% _# \/ s
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )! r* j& U: v0 W# X; ~
{( D( G! ?) Z" x+ [
DWORD nId; 7 K% o# A* _3 F int nPart;0 X& Y: H: O7 D
9 o) v& @; L0 R* J$ C0 |/ G ar >> nId; & o0 d* \0 X6 {% m4 p8 u ar >> nPart; 6 n3 i1 U, H3 i8 S% [* b 7 j& y2 v+ V& @1 @2 X
if( nPart >= MAX_HUMAN_PARTS ) / J6 }/ Z8 n' H9 x0 w& a
return;# c5 y* l' |; p9 ^: B
- @9 e7 ^% u/ Q- u4 T
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it ) W8 C9 m; ~3 ?. | + W2 ^* C, o6 C5 K. q0 ~ R5 v- @6 [, O2 ]0 M, e9 l
Code:3 \* g$ ?: X7 b4 G( j" J6 \# D2 U
#ifdef __QUGET_SWAP_FIX * L/ b. F6 i6 q# Q2 n, n5 B* r6 N4 @- l. T' f4 p
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) ! d+ B; a' y/ B1 V) s pUser->SetHitPoint( pUser->GetMaxHitPoint()); % V+ X4 ^6 g$ N: F9 x 0 s* ]! y O& N$ ?) h+ h2 X8 B+ a if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )7 U* n/ K5 e. u& y* O$ Y
pUser->SetManaPoint( pUser->GetMaxManaPoint() );' g& Q5 @6 f( O0 q
# K. G! z: B$ O! F4 g+ n" [ if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) " s1 h8 Z+ \) c5 H3 ]' f pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); ' ^+ [) X; R/ @! y3 F % C6 y) J. v! i1 N4 U#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp ; U( @0 u. w" f8 J1 }$ Zand add under% O5 D) \. T( O5 X4 l5 |" H
, `: @( W( o) M* K
Code: 3 Y; m" B/ w |& o6 r' v- ^8 e: Vif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ); i6 I% H4 y V$ N, N
{& l6 g1 Q# H7 c; B5 ~- N0 b
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 ); 2 v+ x! V$ Z6 v4 y: T/ c( ] }this / m; c; q* R% G4 k7 L; i3 h. C: k2 n/ e
Code: 9 M' Q" L+ o2 j# m; G#ifdef __QUGET_SWAP_FIX% a0 i) f9 Z' q, e" @* ?
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) " A) {- d! B& y& q- ` pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); 6 F2 s4 C# z- o1 h" X4 ~# J / S- G2 H: _7 U) m- O# p* T if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) ( I2 ~! ?8 z% c0 M* E/ x% Q pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );- s: X/ T, V6 e+ ?5 G, N
6 K& A8 t- h, y+ d/ X2 @1 E if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )/ u5 y; A6 L3 b+ R3 X$ ~: J) j1 A( x
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );4 f9 B1 q+ j$ |5 N6 G8 x3 n% c
) B( e; N [' H# y$ n( |/ | s
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver # ?( A9 I7 U4 {/ D% F
8 e6 D* H) o6 c) x) K