飞飞世界论坛

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

作者: 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 & N+ I% E9 m% q; p; a
I posted this because someone kinda posted a youtube thingy about it :O.
: I' e6 V$ j" O) p& ^6 `( V
5 N( r. ~: F/ U6 T' y) _) GFind this in DPSrv.cpp @ worldserver/ l2 M6 T* H- W
- }! D; W) J' U# K, Y9 z
Code:
" L( z, e# G0 \6 ~. @8 Cvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )* O1 R. e8 k9 ?
{" J$ g% T3 F! P& |" j
        DWORD nId;
: N" B0 `( J* ]5 G1 J        int nPart;
* g$ m9 F' A/ L7 Q
! `1 n9 O4 O0 k1 B- ?- i+ y        ar >> nId;: O7 {+ s3 }! `& \; z
        ar >> nPart;               
. w* A: r+ F1 P5 I$ n2 d6 M' H       
$ z: w/ u0 p8 {. h. f        if( nPart >= MAX_HUMAN_PARTS )        1 f+ j1 f9 p6 G$ ~
                return;6 q2 g" C9 f- p/ O5 K8 V5 @) n
; p8 H. t, o) M. E6 j4 I1 B( b2 E3 n
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
2 R" y0 t) p5 `3 L
) y2 s8 s2 L4 h; k* u* b( `. _& I7 j2 g1 e# y) q4 M: M( x0 ~) m
Code:
; X+ G- f' m# \8 g#ifdef __QUGET_SWAP_FIX7 `: h9 O6 T) P
3 n/ a+ H0 b6 V) e% W8 v& ~' `2 U8 o
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
' s( i5 c. x  x2 Y/ [                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
" f4 R9 Q1 S2 @1 _* ?% H
9 [0 }. P: r! V4 D& c. F$ W                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
- R! C0 S6 q. j* V, c# J& E2 S                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );) q0 ?: c0 y& u# J& Q. S: h

2 X" m" y8 S& E. a) k) b) }. \                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
/ r7 w7 U7 Z: F' k! @                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );! M: b4 E2 E1 E# a3 z

8 ?7 O" [) Y/ \' I& h3 z) h! O#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp9 h" k( U9 _* Q
and add under& A. l3 K, L( R
! Y) Q+ ?# J8 K) H9 j9 @/ G% P
Code:. j  P/ W" r2 {, Z/ k
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
, Y1 T5 J, r5 z( [0 e/ o                        {
1 }7 }6 m4 U3 s$ J! }: o- e                                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 );
0 W# c) y- h- W. w                        }this8 z8 A. ~# ~& u/ I! K

. `7 c+ a; X" k& W9 ACode:# B- Z1 A; k3 @6 S' v
#ifdef __QUGET_SWAP_FIX
" C$ N$ N1 _; Q& C3 n                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
& h: Y# n4 W/ `( k: o5 ]4 W8 a                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
. @1 t  h" \5 W# g+ j7 ]& S# D5 {  }3 o$ l3 S- [
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )( i/ h& ?' `: F$ T( S
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
8 O! @' _9 I' t! a2 b' U  O
9 a$ u: s& \; i$ q                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
6 {& F6 F6 @/ {' _/ t5 b% y$ |, T6 d6 z                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
. i1 F0 x8 g4 C' s$ `& k3 a  V
* p. [  q5 P  k* c! U$ [#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver " ?8 \: @, e/ d( ?

& H; N1 q6 f! Z& S2 m
- P! K, W# E2 w2 ?) ^% B




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