标题: 修复交换错误 [打印本页] 作者: 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 7 c8 `8 x4 C3 FI posted this because someone kinda posted a youtube thingy about it :O.0 V, D: F" ^! _8 z. j
0 e: T, J# S* ~: p$ b2 DFind this in DPSrv.cpp @ worldserver & t' U9 B" ]0 ^( E. w) Z. z E9 T2 I( I5 u. I$ t. b5 sCode: 0 n- S3 a/ l% P3 `* `void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )5 W4 z# P8 _+ U. k/ l
{ * h3 r# B- C2 b6 J+ K7 M DWORD nId;% l, ^" |1 l" H
int nPart; 0 [& N; S s$ j( M 6 F+ G- K6 P! [6 R3 P ar >> nId; $ @3 c" o9 {4 K ar >> nPart; - t2 y9 @$ J) G! F5 V. L% v" B + e0 z: @1 J7 ~) w6 M if( nPart >= MAX_HUMAN_PARTS ) ( s6 o6 j% c, ?4 C5 V. R( @* B! o return; $ S5 i8 ` @1 ]3 |& R: c$ E 5 @0 W0 z0 Y' z+ j CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it. q. N2 S2 c4 p% [0 q
% V8 h. M6 k1 @/ ?5 M% J( [ 4 v$ [7 g% Z# r, Y0 c$ QCode:+ `; s: c8 c/ o C
#ifdef __QUGET_SWAP_FIX 1 s& _! S) r% |+ X: p& a! W8 J4 W1 D3 d/ z0 q
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) ; ~; O0 M }; l; H pUser->SetHitPoint( pUser->GetMaxHitPoint()); 9 G4 q0 c6 D& v# }# Z- ?. v7 T6 l' Q$ m( y& L- ?
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) \, m5 E. L0 \
pUser->SetManaPoint( pUser->GetMaxManaPoint() ); 6 F! u) r- ]% N: J5 N4 I* {5 A7 A/ z8 \! q+ R8 H
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )3 X( `9 b* c' f7 D1 C, Y
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); ) U+ k1 l+ h6 N' a 6 P U, p7 \4 P& L4 F @ \#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp 5 q# Y4 O# V3 A2 l1 mand add under1 E/ ?8 q4 Y0 E1 ?! ] y& ] _
0 x, D8 e3 w$ I$ ?6 t! l2 e0 B& T% F
Code: ( f- ]7 b) y. ]if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )+ M5 B! v9 o' O. @* _# |
{ , X& g$ g' t2 W$ o- f o2 }; W( Y 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 ^8 Z" {# M2 a* T( F }this; M' }3 o, k% x5 g/ G
2 s; F0 h4 ]3 p. iCode:7 [5 o! R) _0 y" {& d6 O7 G" l& s7 h5 b
#ifdef __QUGET_SWAP_FIX: f) t# O. w- @, y* R
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) , o. j4 m" C. e1 A pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());* b$ Y7 {) D; O4 h
5 @9 b0 R) f9 S if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ); @& V0 }& k( O; [( L3 m
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); 8 @6 U, [2 N- |* C0 K% \ 8 \7 t, G$ c3 _6 Z if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )$ s5 v9 d: }( s2 Y7 h+ d
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); # u4 t$ ?- P1 [5 Y % X. k+ L6 `* n) u- L* {' `#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver 2 `0 K5 s; H6 p Q: G D6 l ; n! m$ _' L/ _+ j - U; F+ e" e. s; u% S0 Y