飞飞世界论坛

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

作者: 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 : C6 V  U2 E0 w0 f/ s* \
I posted this because someone kinda posted a youtube thingy about it :O.
# o1 H) a6 y/ w. |' A" W8 o: V2 n) N# t* a: ~5 b
Find this in DPSrv.cpp @ worldserver
6 J( }/ R1 O$ h9 `  K0 E+ q  Q* ?" c, v. K. {# |. m% i  x: q+ ?) b
Code:5 F; G$ `7 b+ ~1 T/ m/ x3 Q( j. A9 W
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
8 g; F+ q& b2 e% C4 w: u. i' m{
& m9 Q) P- P7 t$ E  e1 D, y        DWORD nId;& G' x! E* M5 j' S: y; p, f  _
        int nPart;1 C  r& X/ R; }9 W6 \" n, _5 M

- y/ k' F  }( Y3 u; r; D        ar >> nId;
! w* o1 z- \* d# g; v/ i        ar >> nPart;               
! p& M0 ?2 ]; c2 O        & Y/ p! u% p0 \9 S0 f0 F
        if( nPart >= MAX_HUMAN_PARTS )       
7 k' I3 Z. i( i1 `1 i; R  j4 @                return;
& G$ Q" ?5 b: B& u- W9 Z, F( {  P  W4 c0 c& o4 m. F$ m
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it% ~# |+ P- U% H  j; ]

2 G$ P7 _/ e  o3 s. W
& p8 q. _" ]* j8 u) i+ JCode:8 y# s# w! D& R2 F" f: C- V- p+ ]1 g
#ifdef __QUGET_SWAP_FIX
. |( I* {, X# ~1 R; D& h
% H! |$ ~( w, `/ f  X' b                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
, X, U% V0 b/ n% B                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
1 N; Z% l: i# v' @6 s/ ?5 O2 W" A- `7 X: F
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )8 w4 \6 a' w3 v3 }' [
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
; R$ M+ O* G/ I+ o, u4 t" y& E% h' m& u$ H$ W' Y$ l9 C
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
. p/ C9 O5 s- f/ h; N                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
8 u' T0 v1 Y* o! k0 \% f4 G
; F0 P% K9 i5 ], d' x  |5 g! |#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp. Z! h% G% b9 C7 T- V( |0 T4 z
and add under3 G, x5 @9 b8 w7 D3 M% R$ M9 z4 y' G

+ F; i( ^7 ^' E7 L. cCode:1 p$ `2 @$ }. I& k% o
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
  U' g" m3 E  x1 F8 I7 [/ ]+ E                        {3 H$ Y& [- C( O
                                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 );, _: F2 v  o& [1 R: r
                        }this! C' j, z5 d9 e1 C, @

( ^' e& a% o+ b: a) MCode:' x% w. M5 S$ i" r. `, D8 G* f0 C
#ifdef __QUGET_SWAP_FIX
2 {$ c5 `& P- D* p3 f6 v$ g                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
/ Q. |" q0 ^8 M0 f3 a                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());" q2 q( t4 X/ Z% ~' W
7 w: f; T1 e: f5 G! I. g  i
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )7 o* ], P1 ~' O8 n9 U
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
& w! ~% D0 K6 v, a* w! R5 j  x  S1 O3 w
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
7 E/ y" S4 q6 b                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );1 J* L) o0 M3 y; Z9 z7 @9 c

2 i& H0 A9 U2 V9 w$ x( d#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver   n( T# K6 p' p5 Y# u
% P' l# m& ?5 }  I
4 a; @5 }* p/ Y) T





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