标题: 修复交换错误 [打印本页] 作者: 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 ; a6 N" T5 Z' P9 o+ p1 C9 X! k
I posted this because someone kinda posted a youtube thingy about it :O. ; y" z4 N; q* D5 H5 [3 v9 m; w2 t' B3 s5 ~9 T3 \% D7 y9 i
Find this in DPSrv.cpp @ worldserver& S/ {6 w% N% K; i0 E' ?
+ e. Q8 p( m M& y
Code:( m; \9 {& L; |% O( j
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) 3 Y3 t/ T; u s6 E3 X+ I{ ( i- u0 p& n4 F& u( H$ L, l4 w: X N DWORD nId; 3 |/ ~+ S! `4 E0 ^8 ~1 x int nPart;; A' f3 C! b& J5 D4 m9 y6 S
" Q! H$ s* r2 t9 ? ar >> nId; ) F1 B& V* r* |3 ~, s& U ar >> nPart; 9 d3 p' S: _ r) K, R) @ d * Q9 o$ J+ Y1 ?2 c/ V$ Q( V if( nPart >= MAX_HUMAN_PARTS ) 3 |* [# F" F$ P+ n: g8 r) {! M; x
return; 1 I) z5 K' U% ?% d C2 F $ b6 u Q3 Z$ L CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it' E9 ~7 Q2 d' G4 O3 r7 M6 `
% d0 [, ^) |8 \2 i
! p' q$ f) \* |0 |& z3 o
Code:+ @" V( E/ g) `6 U a
#ifdef __QUGET_SWAP_FIX . R9 ^& `# m9 C) M5 B$ t( z % K) w7 f) q* m. i if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )" x# g7 n. t% r! R, p* z! ?6 u
pUser->SetHitPoint( pUser->GetMaxHitPoint());; f9 ^( B+ P0 R( x# A* k0 r
6 u, P( `- R* I) v3 g6 Q7 I5 w if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) ! {9 s I' ~/ E, K1 D7 ^# ^$ ] pUser->SetManaPoint( pUser->GetMaxManaPoint() ); + m9 W% I6 A; o7 m, q: R . t3 ~9 I. s- g- p$ k/ f0 `' X' d if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) ; J) b3 L+ H2 `( G4 m) C7 J pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); ) j% S9 B: s: l+ \( f# S! B( p Y5 v1 J* R3 K
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp : l; s- l* q4 Y+ L; i1 Z( U2 v1 cand add under: q! m+ B# }7 K8 F0 I$ T! D
3 Y& W& w+ G4 [9 nCode: 6 L- v S* w9 a0 s# V% Bif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ), J0 p+ o. j% m
{ $ N! j/ ]/ l( b2 e* p6 [% L 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/ B& A, w4 b2 [9 \ }this: b4 f; y( G" Q
: U2 \4 b9 P, W
Code:1 m2 M9 H& H4 a) E% e9 A1 u
#ifdef __QUGET_SWAP_FIX 3 v- Q7 i0 d9 J1 Z+ w' g# _- R: T if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) + F2 _+ N6 `9 i9 V2 M( j/ |/ m pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); ( s' v8 K2 \% ^" R6 {9 P& s3 h* s1 F; @
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )) x5 T( p b, |& ?( `
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); + Z" n, y+ s6 X! G9 X& g % Q" v5 q) B2 b7 @0 u* O' c' T if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ); x& L7 ~0 ~# n, j
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );: l/ v, N- o. G, }* k& w# D! h
5 w. l- y5 f. F2 F. c
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver 6 d+ E0 B5 x& t! w. z6 H( m1 w2 o. R! y, S) Q0 v