飞飞世界论坛

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

作者: 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
  U0 j# [& J) l2 v6 EI posted this because someone kinda posted a youtube thingy about it :O.
* U' @8 m8 h/ y. h9 q8 X$ G: ^5 X# u  `$ x0 c7 j; F/ n
Find this in DPSrv.cpp @ worldserver
# e% f2 k7 {* X9 `
& a. w2 \' I4 \4 Y0 \6 _4 [# wCode:
4 |! g3 |; |+ ~( @+ g. t7 Lvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
# t- w% g* I* p( q1 Y  p4 ]) X2 c{& W2 l* x* r! F- t
        DWORD nId;% G! b! b" y: ]% \& \0 {) D5 C$ q
        int nPart;6 j% P) c$ V( H  P+ L
1 b+ o$ j8 c8 }; ]6 Z5 ?  B' }6 @& e
        ar >> nId;
; h' f; i) w( d& r* X1 n5 ?- B: {% |" ?        ar >> nPart;               
6 ~. T; c' a1 l+ A' M) k        ( W/ T) A$ ~; t3 ^7 a! q
        if( nPart >= MAX_HUMAN_PARTS )       
" Q- R  P8 h7 M: ^2 O( K                return;
; m7 y5 j, b  n8 U& K8 K3 V' ~, P% Y5 }- H- G( W% r+ S9 n
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
4 w/ j- l$ c+ E' p$ o5 c& Y. P- f+ n9 A8 t' ?5 i% g4 ?3 z

$ ~/ ^' j5 F4 ACode:
0 a& Q) G$ l9 C' u- i#ifdef __QUGET_SWAP_FIX/ ^2 X+ B$ B2 `3 M. P: ]) o

$ K8 A% P4 W+ r1 L; S3 @' V                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
! j. O. ~0 q. k                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());  A$ q2 Y( ?+ \! [- {# R" C

2 {; r- r0 K4 C3 }7 y8 i7 a# w                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )2 k0 A. B! k1 L9 y' d$ `
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
* u+ f9 ]8 {8 b* [
: J# T) }, {1 t5 g7 R                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
. A7 S$ l2 \) K. O9 s! J                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );. T; P% u. U# H0 |! u
/ E% i1 t7 W" N/ B6 S
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
7 ]% X+ U0 M# ^: h8 Eand add under
. j% F: ~( [/ {- ?" k8 ^& x* @# c" e; f  h
Code:
: O: a6 M- R8 j1 l8 v' zif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
$ d7 m* j8 ]' k! X                        {6 x* c0 l( \: A( U1 Z6 Z$ d
                                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 );
. O/ V% x; d) X                        }this. e, o2 x7 w7 E# N' R5 U. M7 Z

& ?# m5 I1 O, k5 M8 A$ K9 _Code:
3 a9 O0 L2 Z7 f1 [3 o#ifdef __QUGET_SWAP_FIX
6 I. f7 @9 K5 @7 _$ q* X. O4 W                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() ), I6 e' ?* ^( j$ z
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
! g# _3 e1 T$ F- B# g5 w! v
, D' p/ F/ R$ V6 m- g& ^( }. r                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
/ c; F: X2 m, L% p0 }                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );8 Y6 F) j( t' `  R6 `7 R

. M2 F8 F0 B2 Z* Q  Q2 V                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
) G4 Z! ^4 \2 G6 I6 M                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
) O* n1 ?" n/ C0 e* h+ v- U/ m$ ]6 _2 o4 k" h/ q" |
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver 5 U$ S  m5 \/ k+ F# d

( [* p: j: v: @: O3 y3 U. M1 x7 l
2 q3 v9 I# Z; F' v




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