飞飞世界论坛

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

作者: 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
- Q# u! b; j  W9 x) QI posted this because someone kinda posted a youtube thingy about it :O.$ @/ K; a! ^* z+ |
" }5 i) L/ U, M9 p. f1 V
Find this in DPSrv.cpp @ worldserver' M  ^4 `$ }7 a9 f
+ `2 c/ p% X! [( s
Code:6 c$ j6 {  m( B2 P; _( u
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )8 _- A1 M" J3 e. o+ E  a9 a
{* l& C- m0 v8 s3 r! V
        DWORD nId;4 u5 V; M4 d0 d3 ?4 h9 C
        int nPart;
/ T: G4 h9 V3 I6 X; Z2 m
$ w# o. G2 t" H, M        ar >> nId;0 p' @  V7 @6 m5 r- L5 w, P
        ar >> nPart;                - s; x; E0 @) [' E& S
       
/ Q3 Y( T* ^+ q6 D) @        if( nPart >= MAX_HUMAN_PARTS )        2 M+ c) F+ `  [4 Z! g( F
                return;4 d- Z7 X: O& d
; d+ K, E$ x* i9 U3 i' h; p
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
" r; D" k2 l0 z5 H# ]# T
! G9 P5 f0 C$ s$ W- X. O
1 [/ H# o! ~. O3 [# @Code:
. N/ v+ L) t: x, k7 ~1 G) F#ifdef __QUGET_SWAP_FIX2 S! w% p% u0 }. P* J+ f- r

2 I6 ?6 j* u( \; w; l                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )( n- b6 T. z$ X2 U8 L* X
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
% C4 ]: x# p+ q% V! S% I2 B5 n0 V2 [. R, i: R7 ~) B9 y: t
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
5 H4 p" N# [9 a4 w, Z                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );0 h  Z: ^) h5 |: |0 I
9 v* K1 w) A5 G% z: @$ c3 s3 I
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() ): }" R  S5 S% q6 }
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );5 A+ ~& \4 _$ B6 u8 v# n, E0 ^- Q7 d
0 p2 v" e3 q8 j7 c/ G
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp/ U1 l6 T3 R# O  W0 T
and add under0 }+ }8 L7 I, @+ j
- w3 U8 p5 p4 L5 O9 @+ `
Code:+ @( N' T  B7 V- R
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
/ ]/ L" R; x4 g5 f! e+ V                        {
& C* o6 I5 ]* Q0 \/ {                                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 );
) L5 F" K. r- ~9 ^( a; |                        }this, \4 e, ]" _! @$ d5 ?5 D

7 k1 F1 R8 |% x- k" [- ZCode:
  W+ i: ?* e8 w* _  T7 S$ z4 t; J7 _6 f# ]#ifdef __QUGET_SWAP_FIX
+ N. H+ u$ @7 v* [. c                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
1 {' X5 M' b! d; ~0 B# ^5 k                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
1 u' {2 V' I# o1 m' ^! a
9 p6 [/ v! M+ `                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
! G& s0 d, A6 D- \6 _) m. W                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
: c7 g6 h# E" a- z1 Z  j. t! {
$ O% a+ Q# B" R1 i* x4 l                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
- x% U6 o6 l. K7 b( }. V                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );4 Z4 G" r; b  V' I( [: S
( }- [& L3 h$ Q# ^$ M
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
" m* F8 _: d! s, Y& Q7 e( T  @
" G$ P7 v) n/ z9 j2 V' f2 [+ r: _6 Q+ v( Q( u* L1 V; P$ o3 E: k





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