飞飞世界论坛

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

作者: 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
: Z0 K) j. g2 F1 fI posted this because someone kinda posted a youtube thingy about it :O.
! M; p3 X8 r9 M
+ S5 S6 v9 Z, BFind this in DPSrv.cpp @ worldserver0 l+ Y: F& G! h% A

0 Q/ c, s2 z  }' r! @Code:" V0 x# r# M- t
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )$ Y  O; S7 I0 R5 Q2 P
{5 ^/ f) V& X' ?% M4 K+ v, J% A
        DWORD nId;* _: [; `+ |2 x! O: i/ q
        int nPart;
/ |  X* F- y$ P/ B2 ]- G' S5 f1 s% s9 V
        ar >> nId;5 S, R# i4 Q# i# `1 N
        ar >> nPart;                * b7 b* v9 z0 \/ p' u
        ' R) ?8 n( s  _$ T3 E2 F
        if( nPart >= MAX_HUMAN_PARTS )        + K* r7 _: j8 i0 ]
                return;5 z) @4 f  c/ A; X. y
: i' X9 q6 G9 n! {2 N) @
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
; w$ o3 K3 y, O9 p' f$ I* p$ x- U! Y' t/ Q9 [

$ b- W, e8 u4 z: E5 u8 |Code:
8 M- A, ^5 Z$ o8 T6 p! |; [+ g( L#ifdef __QUGET_SWAP_FIX( c* L3 V' l$ m

4 ^0 W7 l* ^! z6 Z* `8 Q  s$ P' r3 ?                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
$ s8 @  D; t' X1 C: c                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());3 u0 Q/ M1 P7 N4 Q

$ z3 X1 Y$ q/ P, A, B/ e! }                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )5 Z. X: c. s; N7 f
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );) j, n( f, I0 f' W8 O
* N1 A! y& |" G# Q: B
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
1 j- m1 G& F! F+ N( ?                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
1 o0 o) ^0 b) Z( S$ T; N4 ]/ J' }9 k0 @+ [' J! p
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp/ R' D' \, e0 O
and add under
; y: u; i; |: B8 k  _, d7 G
% [6 m% L0 B( |- \- O0 HCode:
: A& S' h4 }7 Z' ^# I4 i) b" lif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )0 M! h. y3 S5 Z! s
                        {2 c' ^  n3 U& W/ X
                                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 );8 Y3 L/ C4 ^/ a! _8 H2 L' b
                        }this- _. ^  C" i1 e" n
1 `1 O* k+ Z4 d/ J+ ~
Code:
3 H' B: E3 I1 t#ifdef __QUGET_SWAP_FIX6 P1 X0 ?7 F! x+ y. q
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )6 y; o! b# C! w
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());" [3 u# i0 ^# W

1 |& k+ d5 `8 Z- L9 m& F, K                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )$ s+ c( P& Q" X: ?1 Q9 ^
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
$ Y$ K* w7 m% Y, w3 C7 p& t9 M5 u: B+ r* J8 P% M
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
( e* D. m1 K: N, R4 E- e  E, g                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
7 t4 l* K! O3 }% c
3 v) G9 U  I/ `( @4 d# f0 P$ z$ h#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
. ^3 m5 r" C8 T2 ]" K0 a" I* W6 V7 _9 ^4 ]+ Z
2 J  j' t  |- {% g# x3 s





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