飞飞世界论坛

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

作者: 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 9 w9 s" ~6 }: J
I posted this because someone kinda posted a youtube thingy about it :O.
, Z& v0 `. S- [  J
. C/ o& |! g& C! ]Find this in DPSrv.cpp @ worldserver4 f# }& V3 P- ^$ @0 W* a- E2 H6 W

# \2 ~) z  z& H; S8 M3 |Code:6 _, P% C, `8 T# [
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )1 b# N( ~. h  l  V' ~$ k) P
{; ?3 I$ y# y# C: I
        DWORD nId;* X8 `8 \" D; }8 G
        int nPart;6 A9 H1 i: r2 ]
' v) ]5 c/ ^4 z8 I4 {& I+ Q' x
        ar >> nId;$ Q/ r5 n1 D  V& C
        ar >> nPart;               
: U2 k0 S; h( g: S       
1 b/ J( D! Q4 i  T2 r        if( nPart >= MAX_HUMAN_PARTS )       
" V1 G# E- S- @) ?# s                return;9 x" N; O" }, w
8 o, W9 l3 _% ~" i$ t" E
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it* w, I; ]" S2 _  ]
4 u& l( r9 \  W& b+ j3 x+ T& _
7 l9 v& ~$ {3 `: x' O
Code:
% [, h8 c9 P. Q' U' i  @- Q#ifdef __QUGET_SWAP_FIX
# _9 _: t/ ^& j* t9 R2 V: _- x3 I
& `' X2 p9 \* N# s                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )$ o2 O" o' X, d" \. b+ Q, p
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());/ L/ }' P( Y9 ]

/ V" X2 J; U) Y+ X! P- r* n                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
+ x! n' X! F7 r' W+ G                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );. m( Y' l; S( y% `, T& z! \$ b
, M: `3 X2 {4 c0 `6 k0 Q
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )  {/ k  y7 T/ j7 `
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );; l6 d0 R0 k- g2 F  M- c5 {

) A& A% V: d: P5 i1 @6 O* D; W4 Q& C#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
. e: _$ q4 D9 s! B: w  n/ t7 ~and add under
& B/ q$ R5 z& w/ S1 F) \# m: j+ G3 ^* q) t" W$ l1 P  b7 V, k
Code:
8 N3 t- K4 V$ |/ V# Lif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
% N7 V: m5 V3 k& `, k* o                        {
2 J- C; U) v/ g) A9 O  G                                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- k# I3 X# `# e                        }this
0 x& _2 {# q8 N8 b, ], I! E. F% {
9 i2 x& V' i+ I$ W/ h% ]4 yCode:* Z1 J  G8 @- e3 ?! h9 k4 M8 H
#ifdef __QUGET_SWAP_FIX
$ V0 A/ R: q. J                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
& l- y9 _3 l7 \; [$ r" ]7 e9 ]                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
2 T4 e3 V3 D/ S" ^7 f: q9 o9 l8 W1 z3 {. @2 B0 o+ J6 d9 n
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
% t0 ?% v' r6 l3 `) [# F                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );* n/ L; ]5 X! ~/ ?

5 P7 l% j# [# W0 s& Q4 z# R$ _                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
: Y+ u) c- w' U9 X  W0 s                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );8 E1 z5 t2 G% S/ M+ m* G5 H

8 L% N5 y( @1 G6 S0 @6 K1 \0 ]#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
, H$ w, f% Z8 `! T
5 s4 j# f5 }- u
" I3 }1 Y  `9 J$ O$ n3 L8 K- h: v




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