飞飞世界论坛

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

作者: 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 q# B7 D& e+ i) `7 KI posted this because someone kinda posted a youtube thingy about it :O.
) U( I" H- ^5 H8 i& t4 C0 l, k9 G% G7 y6 D6 K, @, g- ]9 H
Find this in DPSrv.cpp @ worldserver
! H, y7 N9 H5 D% m1 n* Q& w* N% b6 W+ c4 p, ~% v' F
Code:
9 s+ N. q( h# n. @7 Z- t% lvoid CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )2 t5 H/ K0 G5 F9 Z" s8 y% B# n
{
3 d! l) O1 B) T+ g" p6 O5 T; L        DWORD nId;
* z) m% v( I$ {8 q1 J+ l$ l8 l        int nPart;
8 J1 H% C9 E) O5 r. p& t4 q$ T3 `( M7 S3 p9 w+ t) o4 S
        ar >> nId;
& t3 k, a8 {: M- L        ar >> nPart;                9 Y$ S" s% G# e* R7 w
        $ M( h, ~0 f9 _2 x; p
        if( nPart >= MAX_HUMAN_PARTS )        ) g0 k$ T$ m6 ?+ L: G8 D
                return;2 k$ j: o- R# ~! v+ _9 |
3 |' k; c, @2 r8 O) Y, B
        CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
+ ?; k* I; V' O3 G; Q) Y) i8 y2 k% |$ W0 h

; W( W' K/ V, Z* fCode:. k. N" G- t: ]# D2 s# T- v% g
#ifdef __QUGET_SWAP_FIX) u+ ]% B/ g- }% P  M  J, t
- `* |, h- R3 q
                                if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )3 T0 Y- ?3 f2 ^0 V7 Z  e/ ]
                                         pUser->SetHitPoint( pUser->GetMaxHitPoint());
1 a, T5 }: z' @' ]$ j" \( y  X2 a2 n+ f6 p3 z' F, t
                                if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
: x3 X: f! h. n+ ^- n2 i                                         pUser->SetManaPoint( pUser->GetMaxManaPoint() );1 m" P! g+ \; M
& C9 Q! s- z3 g$ Q7 l
                                if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )$ V' Z# b" [( i. \0 T
                                         pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );; C% A, M' {& l5 ^. j0 {: z

9 q8 T2 U2 z6 R4 s#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp3 u" w* J) j1 _& _7 z
and add under8 v8 h  ]2 m! y3 X8 g6 u" U

% I2 n  B: S1 p: h& W9 _# D7 B) @- JCode:
* F$ [9 n% J/ S% H) \if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )$ U; ~+ F' O$ z
                        {4 T+ s) n" [$ h/ Y! b% ^4 j
                                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 );% M9 \$ L1 S% _$ `8 W& n
                        }this
; z* n2 D1 z& M8 H3 w+ U0 T& ^. z. G  `8 @' l9 X: A8 T
Code:
: Y3 D! ]* Y9 w, _#ifdef __QUGET_SWAP_FIX: y. U( @; v, U
                                if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
3 f6 D1 v, f% H5 x- l; v                                         pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
3 \5 f' l4 E2 I3 Q: a+ x. h* [) p7 K  D. }% z; N  y5 J
                                if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
! c' p' D% A8 g7 G                                         pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );; r. l( I, r' N( |5 h
* H; X# H% s6 M- ?
                                if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )3 S5 z: H2 m8 C3 s
                                         pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );2 c$ ?* E, Q* ?: {6 K

4 |+ r* U5 y3 x' D! t$ c: o#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver " ]: [2 \8 Z$ C. d  L& A

& F4 Y) M& n4 v' Y- `( P$ @: Q' l' l; Z; h, Q





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