飞飞世界论坛
标题:
修复交换错误
[打印本页]
作者:
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
( L9 B1 S1 ~0 h" y2 ^( w
I posted this because someone kinda posted a youtube thingy about it :O.
/ Y$ L$ F% |9 C0 n) D( Q6 J9 ]) r
2 a9 H2 A) H5 D# H7 I* [' A
Find this in DPSrv.cpp @ worldserver
6 L) } g4 p) Y/ T
' d/ s/ S8 M: }1 r7 T# U; c
Code:
! r- L/ o# k, M
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
# H) F, C, M; O6 A
{
# v" K+ q4 T9 z. h
DWORD nId;
/ w% N: N4 p0 g& K3 J! U0 t2 k3 Q/ ?
int nPart;
6 i2 Y, J% I; I! Q
9 D6 n4 S0 r% G! p* H3 J9 f
ar >> nId;
1 a- I& H* F3 O3 O
ar >> nPart;
1 w1 z& f+ a( `7 u/ N+ o% v/ I1 Q
. ~' t" H! ~! L; q+ Q
if( nPart >= MAX_HUMAN_PARTS )
: `6 K% ]0 X. N, l5 Q9 ~- @. c
return;
1 q. U d" M5 k% z" K! A1 }
1 S% e" e! u9 J% c- C8 V# U
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
5 ~0 h% Q+ V& _) ^" Z
4 B* s+ W5 ?* l [( O/ l8 t
" R# Z. ]2 o' D0 ]& y; e) H
Code:
, y! Y D. p, I" L
#ifdef __QUGET_SWAP_FIX
- [1 k z9 N6 b" s3 O( Q/ h; a2 J6 n
( ?3 Q! O5 N6 X0 ~! m( {
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )
% _1 C' m& \6 W& A: N; d
pUser->SetHitPoint( pUser->GetMaxHitPoint());
) v9 ?! T' `; P( Y+ y
; O- J7 _! b. v% `- I! d$ J0 g
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )
% y2 V# I; x6 F
pUser->SetManaPoint( pUser->GetMaxManaPoint() );
0 b: E0 U5 m3 k. G. {; y
& o$ f# X0 U1 I7 Y9 }6 n$ R( X' l
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )
: F4 J! e" e0 @. G5 l
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
! i ^1 H- L( V; G) U
& s: G$ a5 `) z1 M+ Z# W/ [& U
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
g/ i, h! Q: e
and add under
# z7 J' t6 k) x- _6 E
+ |! j) K1 W3 P4 b% L; f
Code:
0 j# [' h6 v+ S- e
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
$ y$ g2 o3 B! D: _& X% {
{
* Z- \, A0 j/ V. Z" [
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 );
5 R6 I; L0 c2 q$ }3 ^" K: ^1 h
}this
) Q3 o& M) J) a0 `" l7 b
, o- k; J" {( j0 R
Code:
0 {6 q, u- M( ^" D. d; y0 d4 j- f& w
#ifdef __QUGET_SWAP_FIX
- v' u2 t- e% o! o& L5 a" A+ d6 \
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )
7 B. {; n* r! A) Z' u% ~
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
T" |' p+ e% h3 V8 k" b. V, C
. r6 j8 f. N% Y& y4 N6 T# m$ t- s. d4 H
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )
5 I7 @8 J1 I; A) p! _* h) R
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
4 `0 D [3 f/ u
, a5 K; ]4 m$ A8 g) b
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )
1 o& C6 \: h2 R4 @3 M* W
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
# E% U/ d8 f1 F: i3 G# `, B
5 p4 m4 Y0 S) v- G+ M' B
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
5 }3 G+ H3 ~+ }# G1 b" p
7 F7 K& V1 ^2 p' o8 I2 m4 [
0 Q! B- `$ K0 f' n
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2