标题: 修复交换错误 [打印本页] 作者: 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 % Q+ a" _% S- N& r2 j- HI posted this because someone kinda posted a youtube thingy about it :O.% w9 z6 Y% T6 j, V3 n
3 {4 p `: ]5 Q& V/ f2 ~Find this in DPSrv.cpp @ worldserver- s% ]2 D1 U5 l) n- s. j
# O p2 g$ E/ ^ ]# d% T) F
Code: " o1 y( b2 x Z+ B& F/ Vvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) w' h$ n; ], G4 ]& X
{ ' E. A G; ]4 R# T" z7 ^ DWORD nId;" J+ @1 n# [0 W7 j5 ~
int nPart; 1 ~: `/ p; A8 O, ~7 }8 Q" [ + V! K7 A/ P( \ k ar >> nId; ( Y2 ?! N I9 x: t2 Z6 n8 Q ar >> nPart; 3 a) l, n* i4 l w6 \) B: T
3 Q- N, l9 y9 m- l0 |# e: r& @4 a
if( nPart >= MAX_HUMAN_PARTS ) \. Y: f, Y$ g2 |2 N( A& [, \4 L, ]) Y return;, J( D: G5 h% Z; n( h
. u9 Y; z0 I( S4 B; U6 |8 x CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it 1 ]3 Z \7 u5 X0 a, c2 Z; x+ C& `3 y7 u. H+ A( \5 V
. x1 S/ q! z7 H- [
Code:2 E7 @+ c( A4 z1 q7 V
#ifdef __QUGET_SWAP_FIX 4 M v+ L! L J; e: W$ F ) w! V z$ {" @( V. K) A0 X if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 2 I9 f2 x7 W& O& F" m pUser->SetHitPoint( pUser->GetMaxHitPoint());4 i7 L& ]# A7 Q m$ _( x
% E! S3 w5 F6 O2 R; Y, r2 R6 E if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) : \ d' I$ F& I" O2 R% ] pUser->SetManaPoint( pUser->GetMaxManaPoint() );9 Q$ |: c' }% Q+ p( d. M
i! v4 D& x# p: u3 Z' e0 g
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() ) % ^5 k0 n) U. j5 o% P pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() ); 8 k' z& K0 a% g1 s Y! [ a5 e ) X6 i, } m. k3 T6 P; W+ h2 P" a#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp7 c F$ b" E3 X7 o4 v: ]! a) t
and add under [/ @4 C$ D) F# E/ N4 } 1 y, ~9 O, A m6 _6 OCode: + l7 |/ P4 h2 pif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel ) / D' e1 r, b! k6 z4 K2 e! h {" R1 K e6 d: |5 W1 |
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 );3 B0 p; n; \$ C( D; N2 G
}this 8 I1 b5 N. p" l! a; y* j9 A0 O4 q# g! Z+ I
Code:3 I. l' }$ Q$ K, l: b4 R# H
#ifdef __QUGET_SWAP_FIX - G% @- M: x& ]: B if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) 0 t3 m# s# E3 H& ~: G3 q' v9 @8 T pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); % B7 U k: A! |9 J |( r# M! h' I* I# E : q# N% Y7 _8 l' ]! [' t2 I if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() ) 5 @& a( ]& T. J+ t" ? pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); 4 r1 x& _, J7 N; c$ r. y ; _1 b* }; S$ s8 K5 b! W if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )0 x6 H4 Y: b" J6 t: ^0 W
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); " F5 V$ l+ A# N% d2 _8 }6 d2 y8 R3 L8 R: ]" f& A; O' K
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver : F# c: m: B1 V* k