飞飞世界论坛

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

作者: 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 3 f/ w- y3 x; X( y+ Z
I posted this because someone kinda posted a youtube thingy about it :O.
+ H; y, y2 b! W% o* }+ L7 R( S  w" u/ t
Find this in DPSrv.cpp @ worldserver) P( r! y  z/ z7 _# C4 v6 |

% K0 Y6 g" |) c4 fCode:; j5 [) I0 @; x2 V5 _+ d
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )1 K0 {, w5 ]+ M9 {' O! p
{
" ~( U/ G- c  i# f* E        DWORD nId;+ r" J+ _7 B# y+ Y
        int nPart;
; K6 d# C2 `5 M* b7 Z" d4 |  k
4 }  h, Y* n3 j8 `$ b- P        ar >> nId;
8 C' n6 t. k  x1 F1 u        ar >> nPart;               
) y" j  q: E% Y/ L/ m  I        9 g! v- V1 c: }3 d
        if( nPart >= MAX_HUMAN_PARTS )       
/ e8 p# O- V& ?" s; d+ {8 Q- l                return;
7 F  ~' E( [, v% m% K5 H) n; z
' w& r0 O- Q+ t- z) D* l; o* O        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
6 \) W0 C( K2 x) _4 y9 ~- q" `% @1 G8 N* e) s3 U$ ]

: X& S; ^. D' E* c; o8 m) \Code:
/ R" j3 f! z' `& \#ifdef __QUGET_SWAP_FIX7 k) j3 V" B3 B) v, q) c
3 Q. D: Y8 S: i7 L: s1 s; k" Y
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )* x- r4 @& V5 e# _: |7 i
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
/ X' v- o( d, d0 V: K
; E8 u6 k$ v; `0 h& C7 j                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
; D2 v. H2 u# b4 C5 o4 T4 J, G                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );: {; a: Q( k* j
  w" A: N3 U, f: g1 I
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )6 l- Y1 D' R, r# x. N0 E
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );2 u6 l4 O& w% r# n0 S
( r+ g( a% \6 s8 H7 T3 I
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
) ~, T+ \3 t& R. L9 Uand add under/ \. v4 {, }" M

0 u) x5 _1 y( |5 MCode:
% h! K0 Y9 }: q4 u" y! d' w9 z: G- Mif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
- s3 n+ x/ J" ?2 @8 A: C                        {
6 z1 E9 a  w# f0 m9 i                                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 );
, V' O4 A; Z% @                        }this3 Q1 d/ _6 s! o5 p3 v

6 c* j0 R7 K" w$ ]3 C* i% DCode:
. _7 ^/ W: d. P+ M3 _3 Z#ifdef __QUGET_SWAP_FIX' r" ]& c$ v* K1 J" j1 l
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )) w" N. I8 c, f2 s, w+ m. [9 z
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
8 U& i5 C. y$ I% G& ]
2 |+ C, |' Z; N( P9 ]                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )+ o: }5 Y6 |6 \+ v* y8 l* f0 h4 S" K
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
/ v$ C/ C! F& T( h7 H' U' P( R0 q$ v% D, e: K  ~
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
; m# D5 `5 U7 R" j                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
3 C3 }  m7 i  o  p$ _* t
4 ^# b( R) h4 p' |" k9 y' `#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
4 Y7 f# a+ P: k9 B; X5 C
+ o( E1 Z9 Y1 t8 J' ]6 I* q
3 c1 u! N% l- T4 @5 o




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