飞飞世界论坛

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

作者: 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 & p% R5 q- m: y9 X& X2 ^" D
I posted this because someone kinda posted a youtube thingy about it :O.
) `6 v9 `2 @$ M
* H7 c4 f. E3 S4 pFind this in DPSrv.cpp @ worldserver$ [3 k% X- K' e' K
' l" h8 m9 z. Y  u6 M# Z7 \% P
Code:! K/ _. C% a3 _4 M5 n% Y) R/ z
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )& f& Z* B. r3 [  t. z
{
+ k; c- u3 j! P' W1 k6 N        DWORD nId;
' A, V/ x8 H- |        int nPart;" h: m5 s8 n! h' U9 J
$ t9 ~& M* \  x
        ar >> nId;
1 k  Q% J. A. P# F, B        ar >> nPart;               
# A  m" j# Q: `$ e       
  y9 s% M# q1 N+ T5 ~$ [, v        if( nPart >= MAX_HUMAN_PARTS )        1 l3 a( w/ t& S% C- @
                return;5 J/ R% O6 C0 j& \2 \+ a2 F. }. O+ N4 _

) P  W9 \! e, U, f) c# v        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it/ A( G7 |& Q2 u) C

/ V! ~1 H! g' O$ N* @+ F& C' k; D
Code:
9 n7 c; H1 }" U" S#ifdef __QUGET_SWAP_FIX4 Y/ Q0 v0 ~& e. Z  [( a
2 K8 |- a" _. w; M9 H8 @! e- a6 s
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )0 f% I/ I4 v0 l1 ~. D; M' x
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());* ]3 @) y' d' h' k) Q2 l" l

" q& i3 J/ ]; R& C! H1 b                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
8 o7 i; G! i% V- m2 \                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
  ]  P' {: m+ I8 A! I- o  c' `2 n) y
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
+ l2 q$ ~' m  C$ y$ v; g* w, M                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );) F4 y3 A$ z6 W' h* l+ y

+ I2 T8 Z" N3 x3 m7 O#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp% `; f& m; A: l3 Q) e) S6 u6 |
and add under/ B" H* ^7 z2 G* @2 D# C
4 L7 z5 X4 b+ Q
Code:! g) b. L* @: e* a/ V" {
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
2 j1 z7 m) g- O. h9 y                        {3 T& \+ `- T: i- P8 p( S8 {
                                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 );4 l8 |7 e5 `* `  k, Z; e. k6 [
                        }this
5 t& A% L# u  Y7 w: m& s7 p! c( s/ u( `4 \$ i
Code:* M& @5 O: l, j2 r4 N/ J% H5 \% V
#ifdef __QUGET_SWAP_FIX0 \( T1 h+ |* b  T
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
2 t6 m( ^2 ?% G" G  i                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());# z0 A: V( Z& t8 V+ w

" G( ?3 C( _4 s* T) i                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
* s: Y1 g( ?" |, H- e                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );" \' D2 l0 w9 |1 F! l
# @% V; o8 I1 W3 l# L5 w
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )- Q& A1 ]) N" S8 z
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
3 U# T# q5 B* c" ~3 q- e( m) Q, f' Y+ N
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
5 \$ T  X. e& ]( K" J1 S% v1 e, `5 L5 N7 H

1 G! N( D$ ~; ]/ x3 T




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