标题: 修复交换错误 [打印本页] 作者: 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 + I" y: \# @, z0 Z
I posted this because someone kinda posted a youtube thingy about it :O. 9 G3 ~, s$ c" b# \* \7 H' L3 Y# a3 ~8 p) |7 d) S( D; K7 c. g
Find this in DPSrv.cpp @ worldserver" U5 x+ l/ |8 i R" ^
6 P4 J- H& |; F; A; FCode:; |* _ E" j# [
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) / Y5 x5 ?- r. B& j{& |: ~4 F5 A4 x" S0 b9 W% l
DWORD nId; 8 ]) z8 U' j5 J9 f3 w2 { int nPart;% ~) l" K) p) r+ h+ |6 J
" |3 u/ S+ o6 Q' x' A3 G8 O
ar >> nId; ) ~" p$ Y/ p/ Y2 N; u- K ar >> nPart; % u# p" d( K& _# j% w5 T1 A
5 F, C9 I" A9 G, S
if( nPart >= MAX_HUMAN_PARTS ) ' P- H8 Q# U% P3 ?8 {& {
return; 2 j2 t- Y' A1 J' F, E0 @& i$ D; d( i; [3 e9 P/ o* [+ z# \9 r
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it 1 Z$ u+ l9 i' e1 C' ~, u9 o) a3 d) t2 X7 `( Y" J
2 S1 Q; j6 p! |$ h% v6 W% A- i$ v2 [
Code: + u, Z8 ], J. {+ G2 E/ h#ifdef __QUGET_SWAP_FIX $ Q; }# V$ K- |+ b' w5 O 1 Q2 N% a& K2 ]7 \ n, b1 X. [- T if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) $ L* G3 B. J0 X9 _* l pUser->SetHitPoint( pUser->GetMaxHitPoint()); ) R X; I2 f7 J$ d5 w; M* I5 G( \8 b: d: ?, g
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )0 m+ k- X7 P6 G
pUser->SetManaPoint( pUser->GetMaxManaPoint() );( _& D) G* h. p( N8 k; }/ S
& W7 j7 k$ n& y! ?( t2 ~) a: }& `
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )& V7 l7 S2 r/ ^
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); 6 V& i* z; a* r$ X9 U$ C7 p5 K2 K7 R' q+ r, ^& m
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp z: r4 j+ h7 A% z
and add under 4 a5 _9 J# L/ ^' @% @4 Y d+ f; f) g5 x# H/ f
Code:7 P. z1 Y: p* Y. Y/ t3 g
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )+ z" i/ @4 z- z$ d
{2 [% n" u) m3 a' l. y) O# \5 l! h9 y7 P5 [
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 ); 9 B0 n* N# u7 y }this+ K1 h! u0 r, E$ w# q" }# X
& E& @2 M7 @ v0 X0 A
Code:- K, i( c+ D3 C; E X, i2 ~2 Y2 {. Q
#ifdef __QUGET_SWAP_FIX 7 Q8 O B- Q* E, R if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) 8 b4 u+ r0 Q% U! Z' g0 u$ d pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());' ]. u4 x8 p; L/ |" [
: e- v5 R" t, n; _2 Q5 `
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) : J( J' n: m9 W4 H8 K6 D. _ pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );* E0 l+ M* G2 P7 ?, i9 ~) ]
+ a; Q4 m, x" [( Q' D( a
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )' B! k. [5 C$ W2 P6 f- l
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); & P# n5 g, X0 q7 i H; Q! U u5 |9 b2 U
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver 1 p6 j3 W' G+ q4 \! o& }; X* j9 ~* b/ y. }( T# T1 r0 S: U