飞飞世界论坛

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

作者: 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
! r( O  u8 o8 o  d+ r  `9 [I posted this because someone kinda posted a youtube thingy about it :O.$ |. j, w' h1 l8 b

* a5 c0 S9 O5 {$ V! xFind this in DPSrv.cpp @ worldserver" [5 ?& U( E& Y

$ {. X/ B  m6 z+ M% ~" [$ }, nCode:3 U8 {# e/ x  J, F  F3 l
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )* ~  S+ Y% Q" W4 y; z! i
{$ [1 @5 i8 S( {$ S# f
        DWORD nId;
$ D, o9 B+ D  d0 i        int nPart;
) r$ u2 K/ ~/ }: _" R0 X% \7 y& ?( p0 }/ j
        ar >> nId;
$ S. y/ f& {6 x  r" D        ar >> nPart;                ; {- e! y  j! h$ \' x
        . v. ?) ?" O& \2 W
        if( nPart >= MAX_HUMAN_PARTS )        7 Z) x% g" t. ~3 u2 b9 A
                return;
0 {% ~; F% p8 ]& A2 w& t
/ ~0 f' o, }7 n! C8 R5 r1 R        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it. |' B0 u2 u# c1 V! O" X
. a: }( }, ~# r$ y4 v6 U0 s

% L; E) M2 u! v8 M8 P1 Y0 XCode:. y% T9 N" U* b4 z& J8 |, T' o* h) P, }
#ifdef __QUGET_SWAP_FIX
' T$ [$ H6 K& F- z' K, K4 K" ?
& l% q7 \/ U0 q4 C                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )0 o7 V3 u$ u5 m) U, v
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());: T' H% n) \4 M

* |5 Q& B, L' w5 J9 g                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )6 U' q' V& R' V4 A+ L
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
1 \9 ]2 S+ m2 Z8 O& A2 [* \
% i' R( f& }' \- f7 m8 f                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
" Y# ~6 O# ^4 G                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
& V9 o3 K8 N6 }5 a4 C4 i* e3 V
' m6 `+ }) T+ m$ @  P#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
  L! o2 J* l5 c0 Y. a. `* R1 @and add under7 x' @5 {) S7 l6 e$ t- `
5 y) }4 x; ]5 a' I
Code:
0 k" W! l& {! _1 c9 {9 j! mif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )2 {. x/ W3 }9 F4 n
                        {  R  {9 H1 k* O9 }2 @9 G8 T$ n7 {
                                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 );( ]+ k" O0 g- M
                        }this- P+ N7 X- p+ V" H& B8 B, c
6 l, [+ j& ]4 h; q  R
Code:3 c, b8 L+ R) `8 |$ w8 m
#ifdef __QUGET_SWAP_FIX1 B. h0 Y: ^; P' a
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )% @+ q  d6 c! E' W
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());3 w1 _3 g8 I: n* ?$ p& l& O# ~

2 g' U; O, z4 m1 ]# f                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
) {! V) L' S$ ~6 K- W                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
7 v4 R! d% H/ \' J0 l8 v: ]
7 m1 Y8 i% a5 e( g# Y0 m! k. @                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
+ ^& {3 W& a+ u6 P: C: i8 Q4 T                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
4 A- b( R& Y3 ?# b+ q1 `8 A
2 X3 j3 s- x4 E2 j. \& M. N' g9 u#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
; y; Y9 u3 W4 ]; P$ {  s3 p+ P2 T1 h' W! S7 {

. M, ?$ b# n3 U  j- _




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