飞飞世界论坛

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

作者: 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 " ^$ f$ m$ Y1 O! ^0 i  n
I posted this because someone kinda posted a youtube thingy about it :O.
& m5 H3 S! c# f$ L0 X# h3 u, `/ q: _8 }
Find this in DPSrv.cpp @ worldserver
0 [, {8 P, r, o8 g
5 i" U' c( q) {0 l# r/ l/ p: TCode:
6 N& c# N7 g, A" f  @. }& \void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
( _" b7 U% D3 q6 s6 h. y4 r% H{
9 B1 G, h  e: r# O. A; J7 {        DWORD nId;
2 U. J4 o$ F% O, N' F        int nPart;  g$ N# k# T! a

3 Y" `$ R" R2 c        ar >> nId;
( V* s9 n6 h5 N' x/ F        ar >> nPart;                ( r$ E; q3 L* Z/ h# ^8 a
        # I. o! h" S, e& O- F: M
        if( nPart >= MAX_HUMAN_PARTS )        5 _( v4 Z: k  m
                return;$ \. v! I# }$ c- q

) J2 @) {( E$ ~* s3 T; U; `* T        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it; V3 h& E* @$ b; y4 v9 K, s
6 \1 F6 e: M. O! p% P1 ^
/ t$ S, Z+ i3 O2 I- P( _* C$ J7 E
Code:- q6 F1 z8 n  q, ]
#ifdef __QUGET_SWAP_FIX, u* ~) [+ l* C, P/ }: K
: i, a9 p$ m3 e4 g8 Y
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() ). t/ J: i+ [; V& M  T8 ^0 S8 o
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
9 R7 y7 G+ H4 U! h+ g( t
8 i: a" G& m( x                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() ), V, w& ]* k7 p5 f- q& T
                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
4 z/ P! R' \* a% v5 G$ w6 `9 f, ~0 Y3 l: H$ H
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
2 q% m7 L( }. G' e/ Y' e                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );& ?: Z1 [6 ~( j& d9 h7 F

6 d, J2 e, ?+ v0 P: x5 V9 Q0 B#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
7 K' o7 d2 [6 Y, d# Y4 A. s4 F) `and add under
& D- N0 p6 s1 }  X- I9 t/ M2 _+ T/ ^) q& V0 [
Code:
, \; m6 ?4 V- k9 h6 Gif( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
! }! p& U2 t) q, e- p" f                        {
& z+ E6 u  g3 \                                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 );
. B" u$ C6 {6 A; Y" m' F/ w: X                        }this
5 H% ~' J7 e- s8 H' @2 B. _) e9 }% \8 u! e, d. l
Code:
9 m  G; Z+ O4 r- _- V4 \/ m! K; y#ifdef __QUGET_SWAP_FIX  H9 q7 k/ {3 U  h
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
0 a! r+ E% Y( d, Z2 R! c) g                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
, c8 e* B2 _! ]2 X- O, D+ _, L+ Z( k) o: x
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )4 ^1 L6 V: z7 s; Z6 N4 D+ Z' w0 E
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );3 B6 q2 s( Z  E% L9 C( n* b
4 W, Q) w. H+ \+ C% ]$ [
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )9 V+ l: ]( x/ D% I" n- Q$ `
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
' u; L8 ]7 U. v8 Y# c! G( n- y2 `- V# u
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
% C% `5 {0 D! C- V- S3 M5 W! o7 p- s' d; _

5 L! e" t( Z2 T2 t5 O




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