飞飞世界论坛
标题:
修复交换错误
[打印本页]
作者:
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
]& r7 V# ]2 X
I posted this because someone kinda posted a youtube thingy about it :O.
8 K4 ^ Y% K# P' H1 n
- @+ P* r) x; \4 a8 K4 y
Find this in DPSrv.cpp @ worldserver
; Z0 z! E4 }& p M" Q- z2 @9 y
# m- \" [" W8 ~/ p
Code:
* f: u- C& a w$ L
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
: B& m$ j' K5 l6 m9 _7 O$ q6 J
{
! f3 L. w8 @6 d R
DWORD nId;
$ H1 Q& C+ I: o# _
int nPart;
2 Y8 H, J) v; j0 ?
- p/ T2 T5 w6 O! V" T# \
ar >> nId;
5 C- ~" W1 r) M" E
ar >> nPart;
! \; U: i3 h3 f# ~
, B @: F* W* M& h) E7 i' k" b. B
if( nPart >= MAX_HUMAN_PARTS )
/ n% x7 }* p0 Y4 }$ x/ g$ ~9 s7 P
return;
5 {3 R7 M5 `. a: W+ ~( e( V. l. ^
% @/ c5 r2 ~. v4 }" g( [" P* z
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
9 J; P4 N# L+ E1 f) ~; g
1 d+ o* A; G+ ~: Q+ s9 G
" i" r' R4 N: m L
Code:
2 \% _8 g5 _; l& b6 k' @
#ifdef __QUGET_SWAP_FIX
6 W9 O; u3 w8 ?; i/ d
0 K C2 C J# r
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )
, @/ N- A" h+ f- `; w
pUser->SetHitPoint( pUser->GetMaxHitPoint());
7 S- l1 i/ ^1 o! I$ _
' A* m& O) K3 i7 {* G6 j
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )
: t4 _ P4 E4 Y; a# O# H( j
pUser->SetManaPoint( pUser->GetMaxManaPoint() );
; f6 F8 s7 K! _- f! J
( p7 t$ m. B* S2 C0 a- g p1 {9 Q
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )
+ M. U/ p6 [2 P5 V6 t- t
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
' I7 j& b1 y! J7 j9 n( r: G
8 H/ H* z, w( z/ c
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
7 x9 Q1 G; z8 n/ c" s
and add under
+ S4 m. N# l% T5 |7 B- Y
0 r7 W' B# ?+ o5 b0 T5 \
Code:
- s; o/ [% z; i$ n7 h6 d
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
u" \$ X+ v& S$ R' @& v' g
{
; N1 x ~% ^2 P7 s6 b- q' p
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 );
2 O6 q" F1 [3 W
}this
: [/ ~) M4 t5 s
! H- z# \6 \1 s
Code:
( M+ {( G9 y4 ^
#ifdef __QUGET_SWAP_FIX
; q/ T' L4 ~6 u& Y* K
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )
7 x6 g5 B: t# w3 h! S4 A
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
- E+ y- `! J0 w, u; d0 B+ W9 ^# I0 f1 B
7 E. t0 _" `6 X2 o2 p5 n
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )
$ P. e8 n. @- h L
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
" Z% q8 ~3 v7 i: K. L4 z* }) w6 E
1 z) D3 _ R/ P0 \
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )
; \! m$ S2 b7 B7 |; `) r9 j
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
& Z7 F; G* H2 T2 a
7 J! a7 X) g" _& W# X
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
8 R+ d/ _* A8 b! B4 q3 I0 u
8 p+ r; u. z" m9 h. S& M1 X. ?9 v
: {% ^3 \3 p* v8 i$ g' M/ T$ S
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2