标题: 修复交换错误 [打印本页] 作者: 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 % W$ {. q9 W4 T* s" VI posted this because someone kinda posted a youtube thingy about it :O.0 K6 s! _3 c* N( W+ Y
4 P& E2 W2 U" z& ?$ s
Find this in DPSrv.cpp @ worldserver ?# c- y6 f' S. c3 p a
- J U4 W$ B: V3 X! g; I& a" w
Code: - O5 d7 n6 u0 ^7 \ p% p; l0 Y# vvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )% v4 w; x/ {2 O
{/ o! R! `; X4 N& m6 [
DWORD nId;9 | I0 P% O/ ?1 I) x
int nPart; - Q; N+ G- X- A9 _7 c' h : R1 F" i, A; w1 T9 c ar >> nId;# ~3 y. F C% m+ N" k5 }
ar >> nPart; . U+ i# @5 h+ s% S 3 g+ q' d. R2 x2 b
if( nPart >= MAX_HUMAN_PARTS ) - d+ M6 y% Z9 l2 s7 L7 _# M! o; a8 U return; * q ]4 _( y/ [+ G# \, b6 `' B; S4 s* x 1 |# c5 p, n7 L CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it 6 B+ I$ K {3 j+ t6 @ : P' C" B) @2 t) x% e% D6 u ~2 r k1 A$ X. f+ c7 c9 qCode: j8 \" S! Z6 W* D1 g
#ifdef __QUGET_SWAP_FIX$ l }6 Q% J3 N2 X! K" P
8 h% F3 j2 W# a: S# t% e5 U6 o- F if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) ! N4 P! I8 M; U+ ?( t, \2 O pUser->SetHitPoint( pUser->GetMaxHitPoint()); K% \& t" U7 K# I9 {4 r; v/ r& t; W& t( F e! G3 H2 l8 \$ v0 j
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )6 a' r3 y' Q5 v9 a; q
pUser->SetManaPoint( pUser->GetMaxManaPoint() ); 5 R4 ~, i4 o- F8 A: W9 h- \% R . ?; c7 @1 _5 F' W' u" Y* Y if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )9 w2 C" y% r- P; r9 M j7 l! Z
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );+ R9 F- O0 I8 l) J
* W1 _! Y+ L; V, ^7 p
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp7 I9 r0 q4 f6 d$ j. M
and add under, L. l$ D8 q6 }9 W; i9 h# c. U
! v* w4 {' J# p \3 Z9 QCode:" O1 v1 _9 ]+ d( f$ n6 c. U
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )5 @, E) Q1 u: I4 r4 H
{ 6 B1 E+ a$ [9 I7 x 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 );4 E8 E# ~0 B- ?& V% M0 H5 }* ]2 U
}this. ]0 x% A: h- G7 l" x: h8 R
. R4 @% s8 G" P) }$ T; j8 OCode: 4 s% W+ {$ N8 |. L% B. g) Z) D#ifdef __QUGET_SWAP_FIX - f& K' P* S1 W3 s if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) * h/ a; k, A6 c' L: P; w, s0 K$ T pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); " J; t" l& K/ s, Q5 J+ C, p6 M# [' g" x2 u8 m6 r
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) . g6 Q1 d9 _$ z) C3 F; u pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); 4 d- G4 z, ]+ p, k $ R W9 M% O z3 n0 q if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )! @) q1 g& d+ y# ^( u6 e
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); 1 z$ @6 T' X" Q1 {: t& g$ t0 ]/ \; U0 @! ?3 G, J3 G0 t3 G( E, K
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver - q+ S2 ~, L3 B5 A2 g M
5 p. j0 u9 S) Z" y8 d( y/ g 4 ~2 ^( o+ m9 ?* I9 X# X