飞飞世界论坛

标题: 修复交换错误 [打印本页]

作者: 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
* x$ v* I4 T; C( kI posted this because someone kinda posted a youtube thingy about it :O.
; z4 L8 O) m+ x
$ Q* X5 N0 K9 v" a/ |/ GFind this in DPSrv.cpp @ worldserver
1 J% c2 l# s# q) h. T7 V0 X. U0 F1 j) n$ P+ [
Code:3 ^" @8 k- Y9 e) g5 Y
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )1 P1 `8 G' Q, |# V
{6 ?+ `% n. `8 @6 t2 k- [  S
        DWORD nId;; o* n6 t# @- u6 Z
        int nPart;: ~* P! p  H$ n
1 ?& s; ], u. E1 ^) G# E5 E
        ar >> nId;
# h; v4 U- U+ W        ar >> nPart;                / e( E$ q* u8 M6 A9 H0 n
        * o( B) g5 d( H" i' @7 z
        if( nPart >= MAX_HUMAN_PARTS )       
' c, x4 e3 E) t, t1 h9 A4 q( [7 _                return;
; C: O8 \7 p3 h2 y
0 D7 `  y+ @; g4 N        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
2 \; z2 w, y9 q+ ?# q+ z4 Q+ c+ l& ^4 ~3 q
5 P! q  d! |( o0 D; W$ C1 N
Code:3 l" M) W0 x8 \: v
#ifdef __QUGET_SWAP_FIX
9 [1 }; O1 m/ u% Z4 Z/ S/ a% S
- D4 d$ ], l7 z4 }8 ^9 f                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
2 |, G5 _. _/ P0 w$ v                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());8 A+ M+ o2 M$ l4 X* B% Z. {( Z
3 P, g; u5 h' ?/ p- ?! k0 _( N' e9 s
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
% W* ?% A- X0 ?; V; P+ S3 E8 g7 z                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
5 \: D# g  G$ J5 V3 Z  g0 E2 i0 L' D, A. W0 T
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )- h! v4 ~. x- W5 S
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );# m8 W  O1 e% V# W: y6 z
$ q/ E7 t8 t' j/ x2 Z" `
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
! B3 W) c' a% N( I$ u% s8 ^and add under  a6 f! Z5 }+ L) R3 ~6 n; K
! V  z. z9 [% P; z
Code:0 ]4 \* o% ]) B" i: V
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
6 X& w( B% i/ {                        {5 j' V- p  Y5 p" g( o& @
                                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 );2 p4 ^3 U; ~& U
                        }this
, N7 w% [/ N2 v+ C; K3 H. M
2 o3 ~: \2 [9 E' ~Code:: c* k6 h- E' \% y
#ifdef __QUGET_SWAP_FIX
: e9 U3 Y' v" e8 S3 Z, z$ P% H                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
% Q- r: k" D; s7 I7 G) n! X                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
% L+ ^, _" ^- e& K/ o" B, z7 v
, H6 ], Q7 D" |) ?6 U5 _* `" t                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
8 b% `- D8 R; C7 ?: m! w                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );" J9 P% }, I& G% M& b! E; z, C7 `

. k3 }5 Z3 d" h1 n3 s4 A; q( I; Q0 k                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )6 J+ m4 }' o" I  A- c
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
  s5 @; T5 i2 g  h3 i: q4 I3 c4 h  I* W& n6 H' q, k+ R
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver + l+ g+ ^! J) ]4 H; U

6 r8 D4 O7 Z8 L# N1 @2 c
) t% W8 i: A3 }4 z8 A




欢迎光临 飞飞世界论坛 (http://www.ffwold.com/) Powered by Discuz! X3.2