标题: 修复交换错误 [打印本页] 作者: 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( ~6 ? Z- }. U' U7 K
I posted this because someone kinda posted a youtube thingy about it :O. 7 B. y+ c3 ^& {1 o# k1 Q: B: F9 @: K) q* M% ^+ c- x8 q3 O+ y
Find this in DPSrv.cpp @ worldserver 2 u) K/ F W0 c& m8 X2 F0 i9 V* U7 x6 R* J6 V. v& W( b
Code: - E% m6 y" B8 Kvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )4 }+ x0 ]! L! _
{1 \) k- ^, y. `# v3 l' y
DWORD nId;9 F5 B, `9 U9 K! Z( }4 N
int nPart;. @) Y3 I8 Z+ ?; ~) Z/ J2 V
. V7 W+ [0 T( X3 j ar >> nId;% l) K1 s( f/ @ U$ G) g% t
ar >> nPart; 6 z; K# q" `* D' Y
1 m- a+ N. k8 `& s9 R2 J
if( nPart >= MAX_HUMAN_PARTS ) 1 A' J0 Z2 D Q# y
return; 4 I* q5 c, I; d3 a3 |3 ? , a5 y& K* o, g* U CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it( n$ c# G" C/ h& w
$ M b% b0 d3 ~: B/ J
* ?% i' l6 Q) |9 ^/ A
Code:( d, E) U: Q6 q8 ]8 q; B
#ifdef __QUGET_SWAP_FIX % p# Q* C3 O* M6 G) \0 L2 C$ y7 u) \* H6 |7 W5 h b- I# q
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 4 K2 w1 R# X& Y. P7 T3 {1 f pUser->SetHitPoint( pUser->GetMaxHitPoint()); ) s; W5 V; ^5 b3 v6 Y+ e! m8 N ! z2 P/ ]6 d/ y2 s if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) A" ?0 j/ K( y9 Q- A# P pUser->SetManaPoint( pUser->GetMaxManaPoint() );5 Z6 w5 B' j n: `. U& n( }