飞飞世界论坛

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

作者: 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 ) g( {( Q; [" N2 p4 g' H$ t
I posted this because someone kinda posted a youtube thingy about it :O.: ?! d' o. X: t( \9 n1 E. s1 x

% F3 l5 d; c' _( bFind this in DPSrv.cpp @ worldserver
( U5 Q3 {1 f; W# N) b
: R$ ^9 e8 W9 w1 ECode:
7 h( G3 D* {3 ], wvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
: R& B0 Z. \& M0 `8 k! L{
  a5 @. |# U) @6 _  U4 z9 l        DWORD nId;
" ^5 m! z9 N5 L; L+ w, s, V4 A        int nPart;
( v4 S0 p  `" c# Y) d
. D9 q, x4 `$ s3 g% R6 v: Y        ar >> nId;) t6 }& o% ~5 E2 x
        ar >> nPart;               
- D3 p  H" D5 h* F        5 [- m% L2 E% ?* k
        if( nPart >= MAX_HUMAN_PARTS )       
! A! ~8 n1 h( u                return;3 S( L' j% [* B' {
5 \! j, Y9 k% {+ ^
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it) P/ d# X& ]' y

1 x+ x* x2 o- F3 ]# I9 Z" H) Z1 N9 N- |  m
Code:
6 y( m! Y1 P4 s# u#ifdef __QUGET_SWAP_FIX
6 v9 k. E. A- Q5 I& Y. `3 g* Y5 V% C
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
4 @; `9 a2 g4 N! M: \                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
* F" u$ v7 l# v( h7 g2 q) b7 ?5 T" S- l; E! @5 m1 J
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
5 j1 {, d" Z  z/ p                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
4 ?* o( r, G2 D8 y# h. p  j# S9 U" Q( G' Z9 e5 J& B) a5 a
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )4 N$ B1 ~: b8 F. j+ [( I
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
* m) Y8 `* k! O
  S: z( q6 k. M; W6 I, x- F4 \3 ^#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp; G9 x- K2 y( ^) R, L
and add under
0 G4 }) R# V$ x
' m- f. z7 a9 k0 C/ a. C; j* sCode:
3 N! {% s- c) \+ D; J' }if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
: h' r5 Z/ f! e) E. A                        {) _: l$ m* H# m$ Y" O$ B
                                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 );
; X. R' j# m) Q* K                        }this4 R# x; l/ {% L, ?# H
' Q8 c$ @* s9 ?6 d! o
Code:4 o/ q2 G1 R3 Q/ R" j, }! K
#ifdef __QUGET_SWAP_FIX
. w% i; |+ X1 T) N/ Q  H                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )3 P( J% y1 ?! W! u1 x1 N& N9 C
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
2 M6 E( X: W5 ^1 o- d; e" q  [" z3 f/ p$ {5 Q' R2 n8 L
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )& i7 K& x# U! x+ A/ }& U: ]. }
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );+ P& V6 Q% k  i

# Q# d( e" t% n- T$ {5 j6 P3 G                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() ): c/ F  ~# m. ]
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
! l& d' E" p+ P+ q
( d) r6 }( d: S% H7 G9 V) g8 R#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
3 G, d; S* i! G/ b
5 U* N. w( d. O& O6 @- C$ N& v
0 Q5 x3 q' r7 O# V1 F& M




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