飞飞世界论坛

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

作者: 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
$ U" P4 y2 V2 k* h8 CI posted this because someone kinda posted a youtube thingy about it :O.
* o. d/ p; a% ^( ?/ Q6 e  V
& k/ h, _, E8 e: U- B3 ~Find this in DPSrv.cpp @ worldserver
" ~# I0 c+ d$ z) @& g4 U. N4 ?+ @( W* T
, V- u% R/ D* n. R7 `2 ~Code:6 q' N! {! p- \6 b
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
/ C, P& r( Q5 P4 i( x! o6 E! t{1 [0 J2 q& L) ^8 O
        DWORD nId;
3 o( Y/ Q4 _, U- Y$ f  D' t' f; F        int nPart;# J" e+ @* {4 P& n  h8 j; m4 R* c

% l6 C' p- p  x9 {$ L' Y, ?: I; ?" K        ar >> nId;3 m% `) ^: b$ V3 c' j1 ?* a
        ar >> nPart;                8 f! v9 X0 K2 `7 w, N4 \7 w" j1 ]
          X  k0 a6 A) H
        if( nPart >= MAX_HUMAN_PARTS )        ' F, H$ O0 G% m7 b% R
                return;2 t2 c8 [0 m2 y  ?. m# g% j# W

! ?5 v7 d2 O/ w        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
2 P# ]: f4 S- h% @; p2 s
2 u$ j( E6 X3 J. d
/ ~( M5 n7 E$ J' _% r2 ZCode:4 h$ p$ b/ u1 z, q/ u9 I
#ifdef __QUGET_SWAP_FIX
* E- ]5 a! [$ V: r0 B2 D- o3 \
  ]3 S) y3 s; D( ~, _7 [! T                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
) t4 c6 e+ C# |5 p8 k                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());- F/ k3 e9 s8 B% t5 G

0 F) }/ c/ p7 ^4 D- m, k: p6 h' Y                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
0 n- e  {  x4 [3 X& K9 n, m2 G                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );5 D' B+ U  b3 C) g- ~. u0 n

5 N7 b! e: X* C                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
6 K" d0 ~) j7 {5 J6 j( Q9 W/ B9 @; E                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );1 L6 k: r2 [4 A! [$ N2 r) Q

5 j  O' m! t* f! b' `#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
/ U0 x) H* v6 W* G3 w- z0 M) }% l- gand add under
7 L+ J6 x/ m$ a% s" z0 K# g) e& b3 ?" Y- |$ B, i. w
Code:6 n8 }. N( E! G$ z) f: S* n/ ~
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ). H, \9 B& E/ c  S& `" @0 P7 q
                        {1 ^+ ^9 w0 O$ x+ @! Z
                                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 );  s( F' {7 D# X. p# d( }5 R
                        }this
/ j* a/ T8 A- b$ f
2 H6 c# ?) W" k' `6 Y7 P. g: r6 Z. SCode:- |: X# }; _- f5 S+ u
#ifdef __QUGET_SWAP_FIX. E+ O7 p( z& O0 _
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
# u0 w+ k0 B" g                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());4 d- Y0 ?1 ^- O! r# T/ B
5 C- Q& @$ N! I4 f
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )) \0 o/ @0 S* |: W
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );9 r* e* x8 q) |: ?5 p# }. ]

5 n& H1 b* D3 }8 y! C4 g# D3 C                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )) S4 d4 ?8 t2 k$ o+ o- F, u# t8 C
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );9 t  c% o0 b  i
% s) k6 t, C) [- n- a8 U
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver 8 }5 F" v2 H7 K

- L, m- }* ]9 S7 B* U& C3 t3 w% y/ H% X  d* U





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