飞飞世界论坛

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

作者: 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
% Q9 h2 [% k! }1 `6 G6 z$ NI posted this because someone kinda posted a youtube thingy about it :O.
' i+ l% r0 \" h: j6 |0 f. r8 Z8 G* O1 x
Find this in DPSrv.cpp @ worldserver
2 D) v* `  `1 [- W( \$ G0 Y7 I1 o$ }8 ~- Q) Q  v' T% @3 O
Code:; W7 w$ ^# q$ S0 X4 b9 q- M$ C
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
) ^* v3 X2 K1 C6 t, m8 }{
  s1 @/ w5 N4 t2 D  m5 v+ p0 g6 R        DWORD nId;
9 b" E& w0 k8 c2 s- a# @2 n1 y        int nPart;% E- u" ~, R; U. e" y5 G1 Q

7 Y( m( n; Z) K8 N        ar >> nId;
1 E6 w- A  m; i3 X        ar >> nPart;                # V2 }' A. Y9 {
       
% x. J' u4 R( E. s        if( nPart >= MAX_HUMAN_PARTS )       
) i; \. v# i1 k5 j! |1 W                return;* t# N0 ^) q0 i+ C
& ]2 Q) E0 l5 o) h0 E4 h# e& U' K
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
5 d) ?7 y9 }8 y
& u, }+ p% {7 w5 E9 d3 B( }# n( u5 \$ I
Code:& A# |3 q/ q  w$ u
#ifdef __QUGET_SWAP_FIX
- {$ r3 b9 U8 K
0 H/ v, }+ ?2 N- v                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )% L) z, Z! }1 n" O
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());8 c- {  z2 D7 G

5 j2 ^/ q3 a& @. b( w" O* [7 S                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )" n% x) V3 b8 ?* e6 C
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
4 g! g$ ?! f+ D; q- _% W( O4 i6 Y/ S& C) Q' G4 T% H: B! S# A- Z
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )) h" @" R& ^+ @+ C/ p3 }
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
. {& c: g: U, U) d' n
$ }  W! F7 \  y4 Y3 z( P* l#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
! w/ t$ Z+ _# c" [% R3 K, O+ nand add under
7 W# j* K$ b: d3 y, X1 R7 J, }8 \7 ?8 w3 r% ^" J5 G
Code:* x4 @; A. J/ _# S1 P* j; _
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
+ a- O9 _& w& U0 a                        {9 v2 ?/ x7 M; O/ I+ m, G- J
                                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 );
" x& T! Z6 b  {, F" G                        }this) h$ g5 E) Z+ z# y' Q8 @& v! K, G

5 T0 W; ?5 c% u. V. bCode:
- c9 F/ g; P0 Q#ifdef __QUGET_SWAP_FIX, L4 J' o0 n4 O' E" \; b
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )+ H) n7 L. i8 e
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());8 W2 C! J/ D" b* I# I! P
( k4 ^5 N& q( q6 p, V# c
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
9 V# O# ], ]4 X( y% w                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );- \- ]0 i6 \& U" m: l& ?

  ^: }, ~& {: k+ W- D( d                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
6 w6 O3 L0 K+ ], x; N) M3 a, E) q                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );: E6 b: w" d. x" H; D
3 `* T$ y; Z* \% w; O! \
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver ( J& K# U2 H. B+ [

) G% M" Z; P: u: F0 G& u) E  w) L5 o5 J





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