飞飞世界论坛

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

作者: 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 % |7 x3 I0 ?+ g, g2 r
I posted this because someone kinda posted a youtube thingy about it :O." _5 X+ E# t/ t; R
0 p2 _: W& e. @. S; v( I
Find this in DPSrv.cpp @ worldserver( k7 I! B' D& w; ~4 t  t! k$ [

/ k7 Y; e1 Y$ m, X9 E& O# |! [Code:- R! W8 p, B6 x8 `' H9 L+ U* H/ b. o
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
# {6 D  `0 Q) ?9 A{
# N3 d2 {. B& x3 j        DWORD nId;
( `7 N; C5 i2 X7 a3 Q* C0 R        int nPart;) J! t( T6 u: G# a# X7 a/ [! X# y

9 ^/ g( @! @2 K1 R: r" i1 D5 L        ar >> nId;
; u& g  W$ D4 ]9 O) c( z        ar >> nPart;                ! @' l; f0 d( G+ J& L  n  L" Z
        ! Q& Z5 W  x+ {$ [; Z# u* X
        if( nPart >= MAX_HUMAN_PARTS )        7 @' I0 p2 F+ M0 D, I% w6 E+ ]- K# p
                return;) h: y/ T3 F+ D8 f/ Q4 B8 s; W
% w* e$ e) L( V! s# P
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
& b2 ?9 _1 u0 U) @- f
9 s2 s' s2 u1 ]$ }! n
+ y2 _( k& `+ T9 u  \! qCode:. n- P& v( ]3 K0 M, @" f
#ifdef __QUGET_SWAP_FIX
+ c/ @: U! N( }' p! Q
; p5 U* n  s5 t7 e                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )/ \+ K$ b2 u  k- P$ U5 q3 {3 k
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());3 P# b- @; m% |* o

1 Z% Z& L5 L, D1 [% f9 _2 t+ T0 `% m                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )- H9 D6 s' l: \% v8 n8 J) G; x( w
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );0 m+ p2 F, ]" c6 ^

( h4 _0 F7 a. I* k: v                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )& F" o- _% n' C, G9 T- m0 ^
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
6 m! J: ^! u9 }. u% K! j+ f2 [: n& M; e0 v5 h  x8 d% l
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
0 O% o9 w6 p" o# ^% `and add under0 h; P5 n) E' X. y7 s

( C4 c. K  y3 ]  ~$ [Code:
3 B9 f! y/ o( @if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
2 Z  U/ y! I( Y9 b* }4 ?8 G! G                        {: `7 d- i4 l  [# A
                                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 );. |& r% T) V. L1 t
                        }this
$ Y: Z' ~2 N+ b; A! e# U5 e- E$ h/ @" s: I0 K
Code:$ c. \# M' s, M$ Q
#ifdef __QUGET_SWAP_FIX9 Q. E& ]' c. A1 \
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() ). d7 V. t# v% h) B
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());6 V; `) s* A5 D( V

1 Z3 h5 q; U) R- i* q" |                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )" U/ o6 }; H2 N- V
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );4 v1 X: |' T, y$ R
& ?. I3 z6 o' l# S5 z( |+ N$ a
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )0 E- u: L4 S3 \  \: P. v/ E. P
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
) Y4 N6 |2 A% H8 V
# b6 S5 y) i8 W3 Y0 {6 c  d1 S2 i#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
6 }- O  z! Y7 y# y) S( U' J
" Y0 T0 n1 s7 t# n. ^
) v0 A3 p7 g* t/ ^$ o' X) D




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