飞飞世界论坛

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

作者: 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
% E% D0 ^' s6 O7 D4 x% K3 J8 }I posted this because someone kinda posted a youtube thingy about it :O.
! ^3 L( R# z* y8 _, H1 W
6 ^* {' E. e8 mFind this in DPSrv.cpp @ worldserver
! G4 ^% q# x' X- g( `
& K( Y* Y( f* Z; l$ o8 PCode:+ D5 o( H5 B3 U2 d4 }9 k
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
7 w' E& B: X* m, K{5 t1 f3 Z7 `9 k0 D: h
        DWORD nId;
6 G3 P- R3 y5 Q: N& M' C0 X2 g4 b        int nPart;
9 ~3 i- X; ^" H! _# t' R$ z3 q6 V0 C' Z1 ^2 ^
        ar >> nId;" ~! Z4 @- g" [; F, T! p. j
        ar >> nPart;                % V6 Z; @2 s+ v; \' Z& G9 ^. B
       
0 D! S" L! P5 j! L0 S        if( nPart >= MAX_HUMAN_PARTS )          f- i1 ~# @+ U
                return;$ B0 f/ G6 H' y2 N& n: \( F" c' E( m

/ \, g, X  r* M' P9 _# k+ T        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it3 k+ m8 c6 R& p7 ?$ ?3 ?) A8 j
* G$ E0 {( c2 T4 F- c* e0 j
1 E1 l( ~- k0 W: u. a
Code:
0 L( V+ b8 w; K) u& J3 M8 e" C6 g#ifdef __QUGET_SWAP_FIX
3 k" N8 c% d& n, x% p
0 o- T4 E" M0 W- D1 @/ R                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
" h  g* l; M4 c. [& O7 c                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());6 s' v, z* O+ D' m
7 B! L9 h4 ]+ X9 S
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() ), ?. G+ b# ~7 Y/ K& e4 E& Z6 |. s
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
8 `# }' x' \$ S* {  o4 q8 h) [  H1 E5 R
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )+ j0 ]0 F- d# u' w5 H
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );" @8 A5 b0 [. d, n
* h  j; @  V$ Y! C
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp, ~  z9 K1 c+ f* g
and add under9 V6 V% z* L) f6 \+ O; T  z
1 E: f- V: r  f$ y
Code:
- z$ m3 r1 H7 ^* g% m( \$ Nif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
/ a* P; M/ A0 V8 Y8 q, `5 M$ O                        {
' `; V+ h, L% h! R: k! J8 ^' ?                                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% O  R) {1 ?' P
                        }this
& g& V& q. {1 _7 ?. l( j+ D3 D! G, S; W/ u. p$ H% r
Code:5 v/ Y7 C; x+ M. I; |
#ifdef __QUGET_SWAP_FIX
$ `9 N6 d3 z0 S. B' R. S% i* d                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() ). S/ V2 Z  W% ^$ H7 V
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());6 p' j3 u8 a) b0 Z

& V% ?/ O/ u8 J) a6 U- N5 F9 G8 x                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
1 G. D) d; `/ `' G5 G- ^: O                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
: h5 w; |) M5 k# Q3 y' u" n7 B+ }3 Y+ o# P$ m
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
  U/ w. H% [8 i9 ^+ _                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );+ W4 c9 q9 Q* Z" N. @

0 ]7 u* L; j; ?# L#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
$ }3 I8 d  Q( Z3 h6 ?: R1 H2 [
2 I: f( ^( u# Q- Y& d1 c8 ^! Z0 i, s7 G* V6 v





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