飞飞世界论坛
标题:
修复交换错误
[打印本页]
作者:
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
4 _( y% Y# Z; P1 i; `+ p. V4 p
I posted this because someone kinda posted a youtube thingy about it :O.
* t. C3 h% e1 P: d, K' U
$ P9 V: T2 X6 \1 m; y
Find this in DPSrv.cpp @ worldserver
# `7 ?2 D: |7 `
" n5 i! x5 r' v4 U- @
Code:
! V o8 H0 E% a5 L; {2 \
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
7 Q. c% F. b; v2 n+ m
{
4 w3 j0 W, U( s9 r1 I3 n9 f7 |
DWORD nId;
0 V- ^5 s+ I* T& c% S1 _; w
int nPart;
# Y4 m$ o* D% y w* ?
8 v2 `/ |" p: r, |
ar >> nId;
9 l$ b2 D6 [& U1 E! G' _" C W
ar >> nPart;
! A2 Z$ F x3 K, T7 K
1 ^+ O* @! y2 K8 e: i
if( nPart >= MAX_HUMAN_PARTS )
: a$ \7 G% T9 m! _8 c$ H
return;
# R' X' L: u$ d2 Z: r8 r
' P. }6 _: L" Q
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
1 s! e; }& n9 z0 | t* s3 z
0 X: p1 T. i. `
4 C8 P- W8 R5 l8 o- B
Code:
7 d: z& o8 v3 ^5 V7 Z
#ifdef __QUGET_SWAP_FIX
0 N" S1 D' i2 X1 S) C$ n) _
# P+ i$ i' s: }4 U+ T
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )
9 \" w7 \2 r; R
pUser->SetHitPoint( pUser->GetMaxHitPoint());
$ G7 x5 r- V3 s* w, o
2 E5 Y1 [, r3 o/ P
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )
z. n! ^+ ?4 Z2 H+ B
pUser->SetManaPoint( pUser->GetMaxManaPoint() );
) i6 N: @1 Y' \* U+ c
2 ~3 z+ \( I) F/ C
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )
0 h4 _$ ~" [: X+ L. Y) {
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
; G: j, S1 @5 G4 C4 h% w
7 s# M6 j0 ]9 | ^
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
+ w; ~4 r0 o2 R8 A4 Y
and add under
/ Y3 L9 f! C7 I/ S
" |. G" g/ P* W' T
Code:
* |; ?4 j+ f+ B0 g
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
9 T. z! r3 K& t, z2 X6 n( \
{
1 a: h4 q' @0 p j% B. P, j
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 );
0 S/ y! W3 j! h+ J) P# {7 W
}this
R5 V0 s( d9 t
" `$ u1 {5 `9 {/ h! A8 f/ K0 n3 C
Code:
0 J( u' Z ?' r% O+ r7 `
#ifdef __QUGET_SWAP_FIX
4 E4 x$ L* n( p
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )
! E3 R1 C+ D+ h4 u; R/ [6 U9 q8 X
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
- a5 R$ H% S% q2 P
* ?. L3 \: c6 y& N4 I3 ]+ X! ]4 l
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )
! V7 q2 p: v+ Z& U, x( p1 @
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
# U$ w3 S5 A( T5 G
- J% Y4 s* f4 w/ ^
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )
% K3 m* C. K) ?) T1 ?
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
1 I8 \0 d6 G& a: S w' z
; O; |' w' C3 {0 P$ r3 ~5 u; }
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
5 r/ i, W- s g( F$ A. P& x
; s& ^5 s5 V$ o- D% R
9 e6 m% y4 x: }" w: b
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2