标题: 修复交换错误 [打印本页] 作者: 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 $ U" P4 y2 V2 k* h8 CI posted this because someone kinda posted a youtube thingy about it :O. * o. d/ p; a% ^( ?/ Q6 e V & k/ h, _, E8 e: U- B3 ~Find this in DPSrv.cpp @ worldserver " ~# I0 c+ d$ z) @& g4 U. N4 ?+ @( W* T , V- u% R/ D* n. R7 `2 ~Code:6 q' N! {! p- \6 b
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) / C, P& r( Q5 P4 i( x! o6 E! t{1 [0 J2 q& L) ^8 O
DWORD nId; 3 o( Y/ Q4 _, U- Y$ f D' t' f; F int nPart;# J" e+ @* {4 P& n h8 j; m4 R* c
% l6 C' p- p x9 {$ L' Y, ?: I; ?" K ar >> nId;3 m% `) ^: b$ V3 c' j1 ?* a
ar >> nPart; 8 f! v9 X0 K2 `7 w, N4 \7 w" j1 ]
X k0 a6 A) H
if( nPart >= MAX_HUMAN_PARTS ) ' F, H$ O0 G% m7 b% R
return;2 t2 c8 [0 m2 y ?. m# g% j# W
! ?5 v7 d2 O/ w CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it 2 P# ]: f4 S- h% @; p2 s 2 u$ j( E6 X3 J. d / ~( M5 n7 E$ J' _% r2 ZCode:4 h$ p$ b/ u1 z, q/ u9 I
#ifdef __QUGET_SWAP_FIX * E- ]5 a! [$ V: r0 B2 D- o3 \ ]3 S) y3 s; D( ~, _7 [! T if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) ) t4 c6 e+ C# |5 p8 k pUser->SetHitPoint( pUser->GetMaxHitPoint());- F/ k3 e9 s8 B% t5 G
0 F) }/ c/ p7 ^4 D- m, k: p6 h' Y if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) 0 n- e { x4 [3 X& K9 n, m2 G pUser->SetManaPoint( pUser->GetMaxManaPoint() );5 D' B+ U b3 C) g- ~. u0 n