飞飞世界论坛
标题:
修复交换错误
[打印本页]
作者:
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
: O3 l, ]2 i! M5 p# A. }8 F
I posted this because someone kinda posted a youtube thingy about it :O.
9 O. m. ]/ l4 j
5 U8 \& I7 @8 l, X0 Q1 p) k, H1 T
Find this in DPSrv.cpp @ worldserver
- @& w3 \* j5 D2 }2 M. {
6 {1 L. @9 O4 U0 p
Code:
4 y! c9 u$ `( V; z2 C# e' |
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
! ~2 r: T1 V' Y* h
{
2 x: o; c# M: M0 c; `- `. d
DWORD nId;
' K' }, O$ H$ g, v
int nPart;
9 ], p& V; v X! f2 j
: |3 I: y2 C, c
ar >> nId;
1 [; ]% h* w& X& ~
ar >> nPart;
. o! D* E3 M% k9 q. Q! _
( x, }, Q5 a( N
if( nPart >= MAX_HUMAN_PARTS )
8 w: ], w9 s4 l. j! C- j! Y
return;
* W! O2 M5 U* f1 A
) I T% f# O* \& `2 O
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
/ s( I; ?# P1 X' U
" z+ b, o K/ J4 E4 l9 I1 Y; ]
- {9 {: `9 \5 R
Code:
: A( b5 [9 k3 l9 K
#ifdef __QUGET_SWAP_FIX
$ z! S1 Q$ r. Q! b, P: A5 g: a/ G5 o3 _
9 t3 [7 x7 e+ x# y' j) N3 f8 ~* k
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )
+ V( V9 x2 E9 d1 z8 d( W
pUser->SetHitPoint( pUser->GetMaxHitPoint());
- K' Q9 x+ k0 ~. G" p% ?7 T" z
h$ {( S5 E6 Q$ A$ B, m
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )
* G1 l+ J1 h9 I0 ~
pUser->SetManaPoint( pUser->GetMaxManaPoint() );
% O; u! u- [# C$ U/ z
7 J5 U& ?# S9 t" s+ i
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )
" G& d* J" Y# V: ~) p; l/ \
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
$ T, {7 u d0 M+ r+ g, m1 |
7 q& \7 b7 K+ h# g* x. ]
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
0 k6 k0 x) S$ @5 V
and add under
0 u* a* X i9 G2 L- O9 Y
: r# b- w, t4 C( P) P9 ?
Code:
* S, n& Y" E0 \( C7 ]# z( v
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
2 F B6 R; p3 s0 p9 s3 Q! _
{
1 m1 V4 |) \8 k1 U/ l4 l
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 );
1 K( N V/ w+ o, b
}this
1 Z0 h& n" H) z9 i. @
# Y4 n( x# I% X" L
Code:
3 M% ^0 m/ @$ b6 D( ]
#ifdef __QUGET_SWAP_FIX
% k4 G! S/ [) Q+ n5 v9 x! A
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )
& |1 B( h5 Z6 B0 t" |' h9 G
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
4 k+ k, \1 `5 S8 G6 A8 b
1 [1 o3 S2 I. K/ [* o3 |6 Y
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )
( o0 P( ^2 Q' x# e+ @' B" a$ B
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
& F3 j( e6 x5 A ?9 c& C# T
" @% C# l+ m- ?2 p% H
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )
$ [6 N" M" K9 L
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
' t. |4 e3 }$ S' ~, X: b. G% ?
% ?& C/ t% s. l# c9 Q4 w) }$ z* m
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
+ Q9 Y3 m+ j- E+ a& R
0 ?, Y4 {, G6 ~) X# D c: u1 {5 u
$ \0 @- | c4 c# M
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2