飞飞世界论坛

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

作者: 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
5 V. h! d- a; w  w/ U8 V, O  QI posted this because someone kinda posted a youtube thingy about it :O.
4 ~- K) ?4 g  W2 O- Y$ ^
7 E2 v! x3 X  [' RFind this in DPSrv.cpp @ worldserver! k4 U- V& c7 `$ L* e3 y, [) N
0 _7 r( K. Q& h: f. H2 p! I
Code:5 Y) [3 @- ?7 z! G
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
8 B+ o0 Z7 X" D$ h# @{( D; i6 W( o' t  [4 `  [8 P6 Z
        DWORD nId;2 d7 b+ k# |# i2 A* N* x3 h  ]
        int nPart;
8 w9 o. M! }3 J2 j) a0 A% g  B7 n
; B( ]+ R0 |5 ?0 [        ar >> nId;8 ~3 ]! U, O1 N1 L# g' B
        ar >> nPart;                + V( Q* ^, Z0 ]! Z7 O! A
       
" {8 X9 b) z, l; \# z& G6 x; m        if( nPart >= MAX_HUMAN_PARTS )          U0 u1 ~# Z" a9 I  D
                return;9 q) f$ i0 h7 l8 J/ j

# f, q" F0 d0 n        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it! M  e7 _7 s( k

5 w, J4 q  s0 I* K' o; U! p% ~3 b  K6 o( R9 X+ L
Code:
$ u& J& c7 O" }* d' l& t8 R9 d#ifdef __QUGET_SWAP_FIX
1 P( W  n; E8 d! N- \( _
4 f; j; g& h% \" e0 W& F                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )3 r  P! J/ r6 N+ A7 b2 d' e. N
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
/ W0 u' P+ ^  x" Z! n- `  ^& h
& l# c" z3 ~; V                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
3 K" r! ]0 G( G" c( f6 ^                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
  m2 y& c$ m' ?3 Y5 X+ ?& X* `3 X- \% l9 a
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )# N) v! ^, B) ~; _$ P
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
9 Q, K4 U8 f8 b- F: Y5 p3 o6 V  o/ E; N, t" v) j$ y
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp+ }- t) _- h/ v$ W' O
and add under
) p2 {1 h6 n2 k) R( i
% q2 s# g2 N5 v- m/ @8 O5 GCode:/ H( `) @5 N3 O
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )* g0 V  p6 v0 m8 Y- |& d
                        {# v& l/ X; V* T2 X1 X4 {
                                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 );/ p* I- Q0 l4 s/ q( g! h. x3 Y3 c
                        }this
7 U9 r- V  a; H! L, w
( ]+ S4 m" v. ~5 {! @% n3 q) r( h2 hCode:
( s6 M! J, O, D6 V! j% |$ Q3 o#ifdef __QUGET_SWAP_FIX; d5 b( y. @$ H' q! i6 s
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
5 z  Z, ]. F* [7 O. n9 {                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
3 N' [- X4 G- T- Y
1 h  c' v/ `* N& u  i                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
# D3 O$ g7 v- Q) H; Y                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
; m2 L4 C; j& m, i' d) O8 c# q+ Y, c: P4 J. ?. r
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
9 p9 h. x1 A. }! o- V" I                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );. G$ o# Y* \7 x7 M

1 c0 P0 S  F$ ^' u3 g#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver ( Z$ W, H2 l. o+ i

. W( {! b% y2 M2 @& }5 o' k. g





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