标题: 修复交换错误 [打印本页] 作者: 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 $ x! T+ U$ H( j& T# ^$ xI posted this because someone kinda posted a youtube thingy about it :O. 7 f n8 q1 ^5 K6 I) X 2 z% N- h& N- X! sFind this in DPSrv.cpp @ worldserver " i" {, M# e% ^4 f& M% f & s" g$ [* P% ]) I! j* S" ^% yCode: . M4 W9 T- M: `void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )2 v' l! m8 M/ Q1 V
{1 _) r6 l+ A- ?- W. F/ i
DWORD nId; . j8 L9 z. c. w' p1 E" @ int nPart; 7 e! ~9 r- H% H/ g+ O: @5 m4 H+ d( y( _: y9 V8 \+ Y9 M7 D
ar >> nId; 1 r( b3 F/ E& d9 S ar >> nPart; 9 ]4 o) w7 P* V! s# W$ m8 O4 M
/ {* W. D8 U) c7 r' b1 x8 c if( nPart >= MAX_HUMAN_PARTS ) ; s) p6 t% Q2 s Q8 u1 S) S, E5 C0 z
return;3 o* \- O3 ?5 a5 C H) W5 i9 l
- V6 O b! ^" t7 g% l; j$ t
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it ' g- u! K% h- D: L1 c3 k( B2 A + t, V" t# ^/ ` 0 ], Q! s- a+ s" z4 xCode:9 r0 D- {) c: i5 r, c
#ifdef __QUGET_SWAP_FIX 4 F, L# w5 n* E" C& c ; {# i9 h% y8 W& U7 E8 G if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 2 j G" e- R G pUser->SetHitPoint( pUser->GetMaxHitPoint()); , n* L+ E: b6 [7 _+ O4 U2 F. Y# E! C5 q( v; W1 d0 J# _% f, v
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) $ {' i% S% c. h) D* ? pUser->SetManaPoint( pUser->GetMaxManaPoint() ); ! _. P' Y. S9 M4 T& m/ ?: o& E z3 z5 `# e8 \ if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) 6 H% U" }/ v0 b0 U0 J# _/ L pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); S8 m4 H, T* G5 M/ z' G5 ?
# l- `9 `6 a( n#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp; p) P g& o8 n( g
and add under , _, W$ M$ M+ d3 {) s- X8 H N# I1 i# |$ q
Code:9 {- q+ i3 W9 z0 P
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )3 Z- B5 C; P1 u2 e
{ " v( s- U) {* l; y3 f5 d* 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 );: ]- O i9 ~; L$ U
}this3 V+ Y$ K+ g7 _; B
1 s: }7 G8 u; [0 {( g. s% d+ d# y, p9 f
Code:9 ?( v' ~6 I4 h8 L0 U( D0 ^- A
#ifdef __QUGET_SWAP_FIX 3 h$ D! z9 u7 N+ ]$ i if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) - Y l! |! ]/ w! N% X7 M pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); P: B! U( a/ n' B' a6 T* l8 R- b ( D$ h% ^; d( s) \ if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) ) H% H; g3 h0 k0 f" b pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); 9 _" V* ^ [9 T* L - n6 W9 v- c' a; T' o! H if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )5 ^! x5 _: n. W/ _& H5 t$ p
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );, F5 y2 @" o' j( k/ b1 v) e
2 d( Q5 a) B& |/ w. D8 m! ]
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver , \! C$ D0 i0 ]
6 Z# K( L. a# `6 m& H( M# d) Q$ |; z; A: L- G; Z) w