飞飞世界论坛

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

作者: 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
* Y2 W7 Y3 u( O3 E3 OI posted this because someone kinda posted a youtube thingy about it :O.
6 m5 ~! U9 ]. k$ }: b; t% D, ^# A3 _% V+ }4 G5 g
Find this in DPSrv.cpp @ worldserver: ?8 n/ \8 I! W. p3 y/ R. i, |
- t7 B: `$ @8 @5 N5 r4 M
Code:1 Y- ]2 L7 R! M
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
* R5 m* t; ^# c, P{
, N2 B+ e/ l" p% }( H/ I        DWORD nId;, l& c6 F/ J: C$ [$ Z7 b& u% ?
        int nPart;- _4 x" _, O- M9 n+ p8 t

& ]6 {0 c; F0 y  [1 [7 G2 b' [% K        ar >> nId;
$ G; a( r. H! P7 {        ar >> nPart;                , x" c% V0 B; J
        . T' n, S5 i6 d$ B. B( ~
        if( nPart >= MAX_HUMAN_PARTS )       
5 n2 r& r, A4 s# W2 H+ |, A0 m                return;
% b, T/ B# p$ I* P: T) J; T1 o; q( t! }! w* L0 k2 `6 |/ `
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
) ?- l0 |5 J$ ~1 T! b9 i2 v% o8 E1 L  ~: d+ ^, j1 l: U

3 z7 t& x  P7 K9 n& o1 u3 I& G/ ZCode:
9 Y6 J1 H( q+ H8 m% w#ifdef __QUGET_SWAP_FIX# `4 E& w; ?8 C
) |7 c; A" U1 O+ H! q, m2 m6 I
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )8 j% b* m# j+ L3 [
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());% l% {- M2 \) f) o

. l- s, W) h6 T: `                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )8 p  \7 D0 \3 j8 m! m" W
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
6 p! N! \% v1 m+ v1 H: q2 h5 t, S+ v1 F- h; V! G* C% L& \
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )9 Z, s% z3 t& D6 O) B3 Z# x
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
7 C8 Q) ~8 z7 }* @) c* Y5 i3 H" u! O% V3 y) t  C
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
% n9 ^/ j) Z- d3 O- Iand add under) p: A# a4 J; d) x
. i: d% r3 n. ~3 Y6 j
Code:
! b# n+ r8 f) {/ [; d7 [+ E9 `if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
/ L" s! x: p& N# W                        {
* T3 M, k! I7 Z0 s1 }% P$ b9 @- j3 i                                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 );& H" I2 C0 v; M1 f3 {5 F
                        }this
1 T: S# i0 o' d2 D& n/ m  {! H$ {' X: v! H# x/ T, H7 _
Code:
* B' B5 q/ {" x& P6 f' j. m- C/ ?: M#ifdef __QUGET_SWAP_FIX+ a) L6 j3 _' P+ P( v3 z
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )( T! V; q8 P+ w& P3 @
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());+ i7 \+ G( a0 \+ o

! q5 \# A) Q6 \  Z/ e; @* K                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )0 K& k3 X" |9 ?
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
! i3 W; z6 y! |6 A% f* G) U% Y% p' n& r/ G
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
* @+ I! C; `# g* Z2 r7 X                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );$ H% @7 ~5 z. D: Q' Y$ x: B
, [2 a0 l2 M$ ?: M+ q- v. A
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
/ C7 t" _: x3 B. w4 ^4 ^! v- K5 ~9 |1 |
( u9 ?! b; j2 R$ K





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