飞飞世界论坛
标题:
修复交换错误
[打印本页]
作者:
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
[6 ~5 M2 y$ O8 q8 e$ U
I posted this because someone kinda posted a youtube thingy about it :O.
* u7 K' y1 Y& n/ B4 X
7 [) l9 U6 z, j4 P
Find this in DPSrv.cpp @ worldserver
5 {1 R% E. t8 l# p# s# B! L, U
2 X3 f6 ]+ d# L* `9 {
Code:
3 I3 d# i8 {( W+ }: H/ P
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
. t6 s( c- o2 A/ e
{
+ _! o2 F" H+ \' r; l
DWORD nId;
8 h8 Y/ q! z6 {! d3 g2 w
int nPart;
3 P# t( k1 V, v& X
. R3 o" m$ t9 i' M8 M
ar >> nId;
% O- j3 \6 p$ u8 ?, @ Y
ar >> nPart;
4 p5 j5 m0 y* m7 `2 Y7 y: g
5 L3 O6 I7 Z5 l# P5 J
if( nPart >= MAX_HUMAN_PARTS )
. W; [% a X7 Y/ H6 }& A! c
return;
2 {5 |- o. J e: f5 T
$ G# `1 s, X1 j7 O+ |2 s
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );And put this under it
$ G0 e# S$ M3 H# J
; N" m1 w5 \" @3 v
7 I$ [+ k7 V' J! l6 t" s3 d
Code:
1 o7 q) g3 a$ e. ?8 k5 t' }' A5 r
#ifdef __QUGET_SWAP_FIX
2 M+ d% r( {; A6 e* I$ H
7 a$ h8 {' N0 ~7 {. F6 N1 _
if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )
- P$ z! y- `4 \2 A) k( u
pUser->SetHitPoint( pUser->GetMaxHitPoint());
( t! f# W) C0 f* g
+ W' e$ _" U1 H; C
if( pUser->GetManaPoint() > pUser->GetMaxManaPoint() )
2 S: i9 Z4 a. L7 |1 R+ p
pUser->SetManaPoint( pUser->GetMaxManaPoint() );
: V! e- ~1 R5 V1 [
6 a/ W* t2 Z4 c/ @/ @( p
if( pUser->GetFatiguePoint() > pUser->GetMaxFatiguePoint() )
O! P# |4 R1 @8 v5 t6 b, I
pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );
! h7 \4 O# W# V9 b) j; V- [
' G$ [2 ~- X# z5 {
#endiffind this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
@, w. E/ \4 E& t
and add under
2 I% A$ M( ?/ B+ f' Y
! S* h- m Q7 w
Code:
0 l0 i, \4 g- K' r$ S
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
# D! G+ {4 U: \
{
) H$ L: W$ g; }) A5 q, _- D$ G0 m" g
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 t& G& ^( @- m! T& Z0 Q$ @
}this
A: V% ^4 \$ j0 B) B
2 B Z3 i, C0 D: z) p7 r: {& W5 L
Code:
3 A9 j, y1 E3 W
#ifdef __QUGET_SWAP_FIX
; S* s- S' z( t& u. K' [1 j
if( pPlayer->GetHitPoint() > pPlayer->GetMaxHitPoint() )
0 |+ }; g- u' r, B8 X
pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());
/ j9 ]3 I. Z9 m o6 }
% i& ]: M) Q- b8 Z- Y
if( pPlayer->GetManaPoint() > pPlayer->GetMaxManaPoint() )
1 [) S" I& o; V: i
pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );
* g% f1 y, \# v0 ~3 c
, G+ [, ~; v2 C; u
if( pPlayer->GetFatiguePoint() > pPlayer->GetMaxFatiguePoint() )
) o/ y1 n0 ^% ]' R
pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );
' D8 X/ ^2 W7 J2 y
# n3 V* d" F* O/ X: l# A, l, J# e9 n
#endifand then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
3 J4 e3 Y/ E, `; o/ F0 B
4 j9 ]# ~, r+ P
F4 b8 [, Q$ g. f; Z
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2