飞飞世界论坛

标题: 修复交换错误 [打印本页]

作者: 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 9 v: G4 J; \# Q/ e$ S4 q2 h  ~6 D8 l
I posted this because someone kinda posted a youtube thingy about it :O.# r5 B) I1 X) t8 e: y. m8 H

2 F  x1 W5 C- t! KFind this in DPSrv.cpp @ worldserver
% f! u- s1 j9 T1 I+ Y$ K( E
; v4 }+ ~: k- G7 s) ZCode:
; A$ x. x) D( O0 fvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
! T! h% j& B$ `  n. p{
+ G! K& S# G! o& _% X        DWORD nId;5 s4 v; }4 c( u# g7 m) p% F
        int nPart;$ v- X9 O6 r4 _9 ~  j# i4 n

" K! y7 H* [) q" `        ar >> nId;8 O- j- ], Q, ~9 U0 j; U2 I
        ar >> nPart;               
. W$ A( y8 E9 ^9 l# f4 i2 M( ~        3 ^- y; t% p7 Q6 j
        if( nPart >= MAX_HUMAN_PARTS )       
+ Y% `! Y1 d8 n0 Y5 s# o% N2 R                return;' {, e5 }# S  a/ `" }( n+ W4 ]

  @* a" \3 f" I. b( G        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
3 n) u9 n4 X8 ^6 L6 _* g  C
8 i; c! ^5 j' q" B$ F
- Q- Q7 H. `2 @! ?/ H: s. SCode:
) p) Y5 u- G$ S$ Y#ifdef __QUGET_SWAP_FIX, D. s- |5 b8 v
% J, F0 @0 m! o" G
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )2 J5 M, u7 C) D- q
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());& S8 D5 u6 Y8 ]+ ^' m
; o  W  }- a" T, a( ?* R
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
4 d+ l- _" S6 d5 `                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
3 q* }+ c( a; D" t
/ Q8 Z! U# i* t* e: ^1 c  @3 G                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
, e# ~, |. r1 \1 a9 R. E8 x                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );8 r, G+ p) O5 ]
7 |  |! m: p3 p2 p6 o: U
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
; L1 P& g& M; b' H# Iand add under
; g* _1 i$ d* v. U/ t6 p, H' |5 K! [
Code:5 y$ Y  j8 |% d$ r4 ?
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )" `7 p' w& A$ _& ]/ n
                        {
9 |; x; h2 Z) ]' n                                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 );
9 g/ C5 a# q- e                        }this7 z1 J# F/ z% J1 M0 B: d8 Q5 d

! X9 n* A- W. ZCode:
* s7 m) s$ C/ C' z#ifdef __QUGET_SWAP_FIX
* ]6 ]$ m8 W: t) T8 j6 u                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() ), f2 z9 v. l1 L9 w1 Y  B
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());2 B. i% L: R4 E; [+ l  k$ Z/ f

3 o1 I4 O1 g1 D* r+ y5 t. A  _3 b                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )( h* t9 d% Y8 c8 V: W) ?
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
2 R! k' r, s5 k* ?% ^8 n. @8 r' l
% }7 r1 Q* D! }3 q                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
& z) q8 U6 u! m% R9 b4 G5 n4 O                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
# w, U, S+ k+ C( C
+ V( V, @8 l" ]7 I#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
* y3 l* a  C4 x7 d' @- A% o, x- g! E
$ C9 y1 G# {( x$ e





欢迎光临 飞飞世界论坛 (http://www.ffwold.com/) Powered by Discuz! X3.2