标题: 修复交换错误 [打印本页] 作者: 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 6 H; T- J( z9 W7 e. jI posted this because someone kinda posted a youtube thingy about it :O.1 [6 S& }0 o' _. X& {( p" L) v s
* G/ u; q( K' \7 BFind this in DPSrv.cpp @ worldserver6 H+ f4 b. L; A3 W
6 c9 R2 ~; @+ P! ]* v/ n
Code:3 Q# Q2 h! W& Y: K
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) ( u+ y/ Z$ w! Z: T' i" Q{ 5 d2 z+ Y4 c5 |+ y DWORD nId;( i+ h7 i w# J# F8 C/ @5 a0 j
int nPart; / {1 |9 t J& z1 y2 j( y ' B5 q8 ^+ u: r, ^9 e2 m ar >> nId; 9 h$ S& h. G0 N ar >> nPart; - Q4 N% Y( J; f- a4 t" ]% E5 a * v3 ?, q' g! J' @" P if( nPart >= MAX_HUMAN_PARTS ) , p+ p/ U9 _+ f% v3 f
return; % x9 W2 C4 \1 B6 a8 ]; l0 {& d* m( n# m+ l9 F" N
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it + L7 }, G, Y) e4 O& h" ~( u2 U9 w" c$ s% [5 Y
+ d6 d V7 O- O% [7 l8 q& `Code: ( |0 p+ U$ w% C: ?1 j#ifdef __QUGET_SWAP_FIX* p$ h6 _8 G* Q* ]% \; t; P
7 [; R. E' p+ D, |/ o8 s
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) ) U" k7 g7 v }0 |5 }6 I* { pUser->SetHitPoint( pUser->GetMaxHitPoint()); # x F% {; J8 x3 y3 z( b' S9 X% L; }: C1 }. o" M
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )) h- _; i+ e/ N2 @: b; S
pUser->SetManaPoint( pUser->GetMaxManaPoint() );; x4 R: s, \: P: W- F3 ]/ ]
, }- ~1 z7 |. u9 e if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) ; Q. B# W% @& i0 p/ D pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );: n( x1 t( T5 y7 N7 D! e. t9 Z+ ?
9 r; J$ w& T$ f. s0 \/ S
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp; }2 g6 h3 P: w2 A7 Y
and add under3 G' h9 M2 ^! v* _, C
% H8 x2 L/ u0 RCode:/ z* G' J, E* L: L2 x! y
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ): m* \# J' ~; r1 b2 e; V" x! w
{ 5 S0 o, l- q0 i7 {" w1 n8 @" _, B# _ 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 );# j2 i) q, }; d4 t3 q
}this % m& l6 r* s4 ]* D" P7 E+ n & [2 J. U- r7 E# i2 l& JCode:4 E) o$ F# B' N" F
#ifdef __QUGET_SWAP_FIX1 h. h" z+ a) q" G# `0 Y
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )6 |7 g+ s6 ^- A t9 e6 {
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());& ~( a7 P1 a2 z
; f. B' Q0 p7 N5 Q4 f
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) 5 S# }+ g1 m4 y pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); * J/ ^; J- z/ n$ U8 S" p1 D ( d: i: ^% v6 y8 j! r if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )" l" N4 [6 j1 z5 a; n, n2 L& v
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );% d) o. D; o9 `( @2 K8 T5 e
" Y$ k2 Z9 E( M# L6 m* x9 u
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver , @. f r! }5 V4 K& I9 h5 @
& m; P+ e. p: k; z9 o3 C
, f' n" s. K8 Z% _$ B: a' I* c1 o