飞飞世界论坛
标题:
修复交换错误
[打印本页]
作者:
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
9 y8 Q5 l$ R; W! G- R) U# H
I posted this because someone kinda posted a youtube thingy about it :O.
8 ~ n( A7 h& E4 M' f
* j* a5 z% r# w) |) W' h
Find this in DPSrv.cpp @ worldserver
/ K& U% A0 K; a( t5 t# ?" v
, R# ]+ q3 m9 h9 z( I
Code:
6 h* u8 {/ Y3 R% V, V$ p! U
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
1 B" g7 d: Z" I3 y3 r
{
: d3 v5 y% y1 R* r {
DWORD nId;
) n# _: p: H2 [1 V' u8 r+ A
int nPart;
! h5 z/ q% X5 q) a6 a
7 T/ f6 M( O8 L% }/ o: w" R3 `
ar >> nId;
% v5 ~1 E' H" H* s3 h# u4 t1 ^
ar >> nPart;
' g8 _% A! S y6 ~' S* C; G
$ c, K% `! D" b) ~ O$ r
if( nPart >= MAX_HUMAN_PARTS )
& Y& @+ W8 K- S" W& z
return;
0 Y1 s w: S$ ?* a( z% P' L2 z
5 p) Q) @, }+ l+ d' L8 C
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
% z, E8 X: f6 A2 X. o0 `1 d. ]
* C% v+ u% \9 @7 S2 u
# p( r$ `* W4 f% @
Code:
7 @1 N( l' n: V, \3 U* ~
#ifdef __QUGET_SWAP_FIX
- V! P; B( f$ ^$ C- M9 ]( K+ k( i
+ D4 A& t: l4 j. L8 T2 X$ a
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )
) N0 h9 b/ r/ ?3 A0 i* K
pUser->SetHitPoint( pUser->GetMaxHitPoint());
/ M. J2 o. M! q4 {$ @
( b, X* d4 L* m9 ]
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )
6 t! @" F: w- h4 l+ P m
pUser->SetManaPoint( pUser->GetMaxManaPoint() );
8 |! v7 A' q$ s/ u$ x
% G7 _8 k# c5 e4 W2 R9 y. v: ?
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )
5 k* X5 n: Y8 Q1 I0 S
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
# `3 P7 L9 F/ C" V# @: \$ u
$ |0 Z% l5 O) M( Q- {, E- {
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
8 J) W. Q$ F/ q, ]3 G# x! s
and add under
* c. w, x$ @' s7 L
7 M# {- ^, z0 m# x0 A
Code:
' P: T: L- ^) j
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
- J1 _& Y! k$ V4 v9 R$ d' G- O
{
/ p! R& W' m; T& Y3 R
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 );
; S" ~% _9 Q+ j: D4 z% r9 V/ O, x
}this
2 o1 I8 _! y% C* P9 F Z" H
! R* Y/ |0 _2 `- V/ V! W
Code:
; W% t! c7 K+ ?+ X: g8 E7 e
#ifdef __QUGET_SWAP_FIX
3 m7 y3 f* E& k0 ~1 U
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )
8 k* Y5 I8 M' F W& |, L
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
/ d' k8 ^% a: \) B9 s7 O8 O% h- H- p
* w' L2 S* [ S ~
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )
# z0 w7 F1 B$ S7 C: O( v
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
# U! V# k5 r/ O
. C, I4 O. z3 ~1 B2 _
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )
$ v, t( n8 x: s, B* V v
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
- J3 P2 k5 Q2 A8 t
$ P8 f; g: Q/ b3 |! Z- g5 q" G! T) M
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
: F0 M! Z8 q' S% l2 C0 P5 m
q7 a4 ?5 e2 k
) t! @8 | M' X6 E
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2