飞飞世界论坛

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

作者: 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
! z% r$ u0 g1 o6 @I posted this because someone kinda posted a youtube thingy about it :O.
5 \' E' h* A9 c9 `- X) Y0 R0 X  a  [( C: c& e7 ]
Find this in DPSrv.cpp @ worldserver5 X4 |- U# k7 D& }0 F) A; I& |8 ^

& j' ~' o. S6 Q7 M. S8 ]Code:
5 T, n! |9 b& N3 q: y" K3 E% Yvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
& m) c' y, U% S( T2 w{" U$ K. ^- a0 s  ~* b' U# Z
        DWORD nId;# E; H+ X9 Q0 w" ]2 D
        int nPart;8 U9 |. ~4 E( }) _* T& f( c
6 D! i0 D) X' t( c' ?0 m  C
        ar >> nId;
, Z7 P, M* ?! i7 r- S3 C        ar >> nPart;                8 s, Q8 Y" q; }) Z3 Y1 Y
       
% o2 Z, v1 J# K: U8 m% w% V        if( nPart >= MAX_HUMAN_PARTS )       
# l( p: N8 C5 t! z. S$ ?) C7 Q                return;* M4 t( b! p# L; n, @
3 L% ^, K, ]# N, T/ e; g
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it# S2 S) X) {4 E/ S" k; p/ n* [( E$ ]

4 m- M3 G7 x# D6 e% o( q; y" \9 {8 W0 M0 l" O4 d! I) ]# f
Code:& a+ Q6 a- K3 c* W
#ifdef __QUGET_SWAP_FIX
! O* O4 G& a: _) P' \5 i7 C. M* x- L( i5 \
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )! U. H7 b, J" p, F$ r
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
. r. j1 _# ?! E. I% [- {. n# _. y: r- C9 W3 v& i) \) a6 Z
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )9 I- {2 p  q3 y' f& H
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );+ q3 \/ o# c0 \0 b+ x5 ^

2 J5 L- |  ?1 L                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
( ~6 `) |3 K& |5 H, W                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );5 v/ Q- b* q# z, F  V  t. b: T, ^1 h7 g

! L' y3 @8 ^  T* B! f) q#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
4 X; x# o; H3 g' @% nand add under
7 o* L% L1 Y" ?9 }$ W' y2 D5 |8 T& I" ]$ P0 v
Code:
/ b8 o$ w) u8 m2 D( gif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )$ Y1 Y  I- b* c$ G+ |
                        {
/ B# ~/ r0 p* s5 x! m) F" {                                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 );+ A  n' s- k2 p! D  v3 P: \$ Z5 A
                        }this$ ~) [3 G( ^% A( |
; d  B' x) E3 I6 N8 }' U
Code:
  v2 l7 I/ n2 D' P$ W, m, Q#ifdef __QUGET_SWAP_FIX( {+ S. q3 B8 T0 h
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
' e5 V  @8 T" _9 A3 E% w                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
3 v0 n9 t- K1 p' G6 [$ K; f! g7 \2 L5 `2 u. i6 M4 N  w
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
+ M$ v9 ~3 ~, g) r/ }                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
' o5 B' g/ ^/ |7 O9 l5 Q
. g- }2 P; ?6 R! a( i& b                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )6 \9 ?6 H$ ]+ \" H
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );7 B% i- u% k  p+ _
: n2 K, _1 w' n2 ^, g, Q
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver , P  L& ^( Q8 H" M2 C7 g
, ]! Y9 I; ]( _& M) p* y/ r

2 b' r( T1 x" Z1 S& k




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