飞飞世界论坛

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

作者: 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 ! ^% A- u8 ?0 G, E1 y
I posted this because someone kinda posted a youtube thingy about it :O.' A% |4 h( I4 s) V' P1 d3 A
+ H6 f" ^) v+ p% P5 d8 U5 J2 E
Find this in DPSrv.cpp @ worldserver$ O% b+ E% }3 R3 b0 d" {2 |
3 t  [9 e' d! a* w& v
Code:8 r2 {- i$ `( f
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
# V6 _, o1 t( k5 c{
+ \/ n) r5 r7 m& [* f, j        DWORD nId;6 k! _0 F9 K, |9 ~# A7 t& E# }
        int nPart;
8 X8 X1 V2 I8 [. s8 W/ Q' V8 w- a- P& \5 j, d9 \1 E) M- A+ L
        ar >> nId;
* M9 n6 M& G: H: e( a. b        ar >> nPart;                9 t  J' I# p5 T  I. z
        5 h6 }  b+ H) p1 O" }
        if( nPart >= MAX_HUMAN_PARTS )       
  S8 S4 b2 O6 t3 ]' x; b6 F                return;3 }; x3 w+ O$ Q# a

: v; j/ p4 _8 U/ s- b* f/ \        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it2 |3 Y2 l9 m2 w" u$ J

( u& G: v# x+ s  ]) D
7 d3 `- k5 C3 ~1 u: I& vCode:0 j; M" @; p/ a  `: k$ C* t
#ifdef __QUGET_SWAP_FIX( b' H! p$ O1 ~* g

" u! G" l! c# H* h4 V% D. I                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
, {* ?1 [" z6 N+ T0 K                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
2 f6 s/ O9 y6 K' |2 g; ~0 a* X( R) n7 u! ]8 b( c2 A  F9 X
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )! o% w" a. l# J( r8 l4 S2 [
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
# c3 }5 z' i6 l, i1 c( E9 H9 p3 `3 M& p4 P' K
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )& `6 ^6 m9 `; Y
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );; f/ B* ^" j, G+ }) \" k+ s

  ?$ G% x  ]) s9 C#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
, a9 K+ q. ^0 |4 zand add under
# T6 o% F# S3 w0 Z0 b! R
  R' M8 J8 f# u* |" K8 h2 a8 uCode:
: s: ^5 ]' H& @2 f" @if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
& Z* q' b  b4 U3 X                        {
0 Y1 S; P: d6 t( f( e/ e6 \  ]                                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 );
- X7 U/ O2 @9 ~% T1 d6 w                        }this
+ [0 Q- N! A2 {$ ?
$ g" P4 W2 Q, |Code:4 ?, H, o" H: V
#ifdef __QUGET_SWAP_FIX
2 W" s( {" G0 ~& m5 d( r                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() ); L. G  z7 ]; T, Z$ P
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
( _. E+ e# F( Y; ~) \' I- c# Q- y! _0 Y) }6 {7 k) ~5 x
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )& M( v2 G  D! v8 l4 ?4 M
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );6 x: p5 c9 y* Z+ N) |
! Q; I# V6 i6 o5 J
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
% I& L1 l% {/ Y+ [/ f                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
# M  y4 l/ u9 K/ O# Q; I( O; R! l$ |1 |. U' m) X4 o- m
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
8 X  P: h4 {! o: ^* N0 k' `: G
# o, k) O; Y, b$ X. x. P' _5 u- N1 I( o# F! A# A, P





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