飞飞世界论坛

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

作者: 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% k+ G& ^; H! Q% ]6 tI posted this because someone kinda posted a youtube thingy about it :O.& r' g! n7 Y( h' o# }
( a+ D5 [$ }  q
Find this in DPSrv.cpp @ worldserver, P) o/ X1 x5 L, |9 k1 u

& v( R$ x; i& U% HCode:2 U# Y3 V; w8 G7 Y
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
( ~9 O& G% P. Y1 x" ?{# H0 x1 j$ `/ a! P* {. ]
        DWORD nId;( j" k4 A8 O# x( c
        int nPart;
1 E, M  J+ v+ J
1 {0 b& f/ L0 [9 K3 D" U3 h) l        ar >> nId;
0 ~6 U+ m& y% t( S% j        ar >> nPart;               
, U# X+ g( S* {% J4 }( g$ L5 ~# m       
/ f* e; W9 k8 {% S        if( nPart >= MAX_HUMAN_PARTS )        $ _6 g8 T: Z8 h, Z; k0 e
                return;( n% Z- t8 |. {/ V
- K2 y7 d6 E; L2 \1 |3 J4 K
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it; i/ n/ w& Q1 l6 Q- `
  o3 Y$ n8 `  y3 ~$ y0 D

+ Q9 N! ~# z1 @5 {( PCode:* x6 V' g7 k  ~
#ifdef __QUGET_SWAP_FIX4 e/ p; h' Q: w- P2 g& v
9 j/ D! a! U' J
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
$ m1 F) s  _+ N" j                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
5 [+ v& m& v' A' G! o# E) [# T& \( e# u
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() ); {. f7 X9 c2 y* N% i
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );+ s5 ]% h3 f# r" |3 d: z8 R
9 o% O9 g/ w! I* I+ f7 M# o0 H
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
. ?: Z1 w; i  U                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
: F0 \% o. r% D. c0 X3 m
2 M5 S! \! K2 B1 ]#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp, ]( A0 p! E: l+ N) Y; D- n
and add under0 i- x8 D- l6 S  H5 v' M  b

. D( }! @: N% P; h# c- O6 @/ }Code:
+ o! j5 r5 Q: M- S; x6 w& Kif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )* G+ w$ I" i1 n' t% C4 D1 n- ^
                        {
( b" |" E- O+ g% I4 V5 s1 ~                                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 );; R6 T  j6 o; f! L
                        }this1 B) }4 b3 J9 {
7 T; N' v' R* }# c8 E1 j4 l
Code:5 b- x. X1 i4 ]4 J3 l, z
#ifdef __QUGET_SWAP_FIX
, x% d) N2 g" ^                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
* y3 M6 j4 B2 A9 d: s& T0 u                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());2 b2 r* G! |! K  n) d

1 q  b# K: @5 _0 L, M                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )8 {4 F- v% \) e9 ?. H$ b
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );& x8 L2 p  c: x7 ]
; D9 E! M5 D- X# B
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )/ Y* x+ |7 G( H. E* `  f
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );! r& W1 j" `  a6 q. w8 O
; u2 o' n4 ^1 ]7 M$ {8 t- ?% x6 |2 y
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
, O: I+ \8 O2 K( k% I- Y
* h% z6 F- A. ?* Z! e/ d: s8 }$ \2 c) n9 j5 F6 O  ]; K" F+ `





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