标题: 修复交换错误 [打印本页] 作者: 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 4 K! f' R" ]0 b) X( z2 L& OI posted this because someone kinda posted a youtube thingy about it :O. 1 S$ e, K+ P+ d, h$ t 1 f- i ~8 @& \- cFind this in DPSrv.cpp @ worldserver# H9 W! L6 i& g4 E7 c9 k$ P
: o: f5 B0 a& \# P* y# L+ k
Code:8 Z2 t' w" Y, L% F' N
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ) / [& G% h1 j' K0 H{ % V8 G: c: ]$ ^ DWORD nId; 7 D. ]+ o2 K g# Z5 } int nPart;0 l9 N! g0 u" ~4 {. v( p4 f
8 `9 w: s6 E% t/ n) T, r ar >> nId;: y7 Z, d8 ]. K5 q2 t4 u
ar >> nPart; 2 D. B- q2 Z) F- u A s# W- [ # O, a, I5 `; v0 ~ if( nPart >= MAX_HUMAN_PARTS ) ( |, W* `7 D/ M* s. J return;+ w% z# }, W9 Z% ^* G$ W
+ o; l* w) Q" A9 f; m! H
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it 2 B# T0 d' _( b 5 e7 |6 N( r: n L, S$ R: M+ Z+ m" n) ^' j' g9 @$ I# p, ^" s
Code:/ }6 l; K/ A1 ^, R
#ifdef __QUGET_SWAP_FIX C! f% y8 F- Y/ b2 n * `: J9 j" j+ y! v5 X) S _2 f if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() ) 6 A0 E) E. z, T/ M$ R pUser->SetHitPoint( pUser->GetMaxHitPoint());( o3 ~8 h' `) c! f* h( k) l
; |3 S( |; e9 A. ^ X1 Z* d if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() ) % r1 A: d: s) u2 i pUser->SetManaPoint( pUser->GetMaxManaPoint() );: ]( e3 L7 ~6 g9 R- ^+ S" h
7 [' r0 Q& M3 W/ t1 ?- m4 _
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )! m. D0 x- [: h- Y0 r' S: {$ `
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );0 a% D! r3 H4 I1 D q
( w0 |2 l: b6 J C
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp : @2 u: N+ a0 j8 Y; L/ T yand add under! @% H, t2 {) ~- k9 v; f2 {
" g( y$ L3 [& X `3 O& E
Code: ' s6 G+ c* n' O9 t+ C# D( b+ u; wif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )" }- H9 B& L; A: W
{ 0 _/ t2 C8 ]6 Q0 ~, v 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 );/ M1 e# I* v2 |3 ~& k* e
}this , @! t/ E: e2 A * j6 r: P" H; b, m/ FCode:3 f3 y5 \6 m H0 o; V: t' ?
#ifdef __QUGET_SWAP_FIX ) \% O. |* @5 D8 X7 q1 I$ R if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() ) # ?. G" u }0 v! c pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint()); " ?, \( b0 x3 u+ U R5 D* F& E) b+ v4 W
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )) L; s9 h/ H3 Z1 k; i, d8 b& _
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() ); & A9 @! _. y& O- Y# E3 j/ W2 a- e5 X) q
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() ); l5 f' }; o1 }8 [
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() ); , O" H, w7 M* z 0 X) h7 t B5 y P- A: U- ]" p$ m& S9 ~#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver * x, }* \) J* k
: U# U% R- a- F" l" ]