飞飞世界论坛

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

作者: 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
8 x7 Q' Y  l/ S2 {3 M6 rI posted this because someone kinda posted a youtube thingy about it :O.4 ?/ A4 \5 f/ }
2 H5 {) n" q5 z/ v; S/ @5 p% S& B
Find this in DPSrv.cpp @ worldserver& f3 }( K% m; E9 R5 D) }

8 _$ a3 b5 U( r' u4 a2 LCode:9 ^& {- N7 ]; d8 Y
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize ). a0 X% ]. M9 Z; f
{# e" B% A8 ~5 G" H5 N! Z8 q
        DWORD nId;+ r$ j, ~: |$ R# l: W
        int nPart;. T' X, b" f, [
$ [5 Z! |* `9 F" G2 `! Z& v. N- S! J
        ar >> nId;3 ?- M/ Z" }* w3 m3 }5 M, F  q
        ar >> nPart;                7 d, i! Z3 h% M$ K% {
       
7 g: F5 A+ V  I% T! j        if( nPart >= MAX_HUMAN_PARTS )        : _  Y; s* T4 v4 @7 }
                return;
/ H! V5 v% h: K4 {4 O. u4 l" Y$ {5 x4 x0 W5 |: q
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
- Y7 z6 k2 a* @! H- ]2 h9 p! G2 m- c
; h* m1 k& ?! t9 e) v1 @/ X8 W4 p, Z$ l
Code:
' p# g) N: F% F, l/ Y#ifdef __QUGET_SWAP_FIX; d, C3 i5 k+ n; g0 C) _( v

$ i. H6 F, Y. C" V6 o! T; ]5 Q                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
, `' Y; V" v, y9 N                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());! s& d% \0 u; G  s, ^$ d! b

, [4 f- o& Y! l  {                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
3 r- a- D( C  @% |; e                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );
3 Q5 E( [% d# r8 v. w0 ?* l
7 f4 g" E5 E! p' Q                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
3 {# f  F. _7 O( c                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
! p9 M/ N& P4 d9 ~& k0 e0 Q. E3 v. P& T/ z$ {! T( @% ?2 Q2 k. W
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
* P# h' h9 f* _; f7 i# gand add under: C3 R; \0 o) E
6 D- z. z8 l" b$ E
Code:- k6 M4 ~- W6 {
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )/ S; J6 c. p/ i  U
                        {
* r2 D( D3 I9 t" a                                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 A- Y  H7 h$ o; ?+ `4 U$ k: O                        }this) ~: J+ t# v" S8 L& F

4 m. M: ^, x3 ^6 ^( V/ M5 JCode:3 \: q1 Z; P+ z4 m
#ifdef __QUGET_SWAP_FIX
2 W# N1 C% ^3 ]1 R2 H/ q7 l# Q1 ^                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )" G' O: [5 m7 w' t. p0 E
                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());' r' `5 X; y& q9 G
% e" h" D" I  m. n% V  c
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )) O- o+ F1 Z1 X5 z
                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
$ v' K+ c: T  g0 o/ T& g4 I# S4 K- i* t% |/ R. }* V
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
  q( x6 Z: {+ }- V. C                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );) V8 e  ?' X$ m3 N% t

  S, H' A8 F9 Z, I& Z#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
7 Q) W3 K% A+ `( O
* w  L- T' V( f& o
' e/ j% m( W: x




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