标题: 修复交换错误 [打印本页] 作者: 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 + W8 t/ _3 N% ^9 R$ S7 d* mI posted this because someone kinda posted a youtube thingy about it :O. 5 r O! F$ m# P' U/ b8 f1 i1 D+ v& A# G3 d$ f$ i
Find this in DPSrv.cpp @ worldserver: \1 q; j" u W8 D% E
9 @7 p) g9 @6 kCode:& f2 g& P6 b! @( P
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )* Z9 |8 }" _9 Z! ^) K) \/ B
{8 B7 _& ^( U/ w0 H: q& w+ d' c
DWORD nId; ; V" _0 n5 v6 G l int nPart; $ C# e$ [( H, ?% R* x3 s) ?$ L6 U0 s/ v" [: [
ar >> nId;1 G; O- j+ ? P
ar >> nPart; , ~' i; `0 Q. s1 O4 @ : M; H3 A" ]- w6 s; a! m' m8 a
if( nPart >= MAX_HUMAN_PARTS ) 5 y/ g6 y4 k3 V. Q! {5 ?$ h return; ; m! L- G* e- X7 B+ w0 I9 d N! F. k1 e0 Q Y
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it 7 m3 {7 k" i0 g' P( l 2 j. o8 C1 B7 B& H( C) c/ E) e- M$ N, c1 B1 j- s
Code:6 v( e1 _6 `/ _3 p2 S' t/ `
#ifdef __QUGET_SWAP_FIX * O. |! Y- |& S# `$ p5 |" @. L. m p4 @
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )6 a: n+ w# Q0 [
pUser->SetHitPoint( pUser->GetMaxHitPoint());9 {( n1 [: B& ?0 n, A7 q# X
+ a8 z- j( l! w t& q if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )/ o% `1 U# ^; X5 M. I; |
pUser->SetManaPoint( pUser->GetMaxManaPoint() ); 2 m8 T/ p/ L! w* `5 }9 [( R& D3 i( l8 T/ x
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )9 ~( V& {5 t9 s3 ^) U+ H/ h
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); , G' M1 O4 _1 B& u! w5 e8 _! _1 L5 e& C( M% ?
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp q9 K8 |( [/ i& @9 Mand add under ) j j; c- E9 ?: v t5 [+ W3 l& I# zCode: " l6 G! a1 X2 R0 H1 c' |if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )- a8 L7 n7 r- w% V
{# V8 k0 U0 {4 |
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 ); e1 K0 |* N9 U4 [2 j) h$ y, |/ [
}this 6 Z1 F3 U! m0 V: h9 E6 C( r ( b3 Y$ Z/ K7 jCode: - B- S8 ?2 W0 g& B" C8 R#ifdef __QUGET_SWAP_FIX- n* u. E/ N- r: H* Z
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )( @4 P& E0 A5 R6 w- w0 Q9 E
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); ' a/ H: K( a: m' @7 l" X; y9 i 7 O. b# j/ Q( O q$ c) _, q: l6 F if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) ! g' j, a) A8 ~, l6 Q2 V pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); 8 v' Q0 q! A) G4 b4 z5 e8 ^2 h( b8 f. B
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ) Z# h2 L$ z9 X( n+ x0 @- Q3 l
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );6 S, O5 C# M L! R, s% P
% w' o" `3 u) \2 f, j {% l
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver & Y9 u/ K* u, ^* O( o; r$ B, L! l