Swap bug Quick fix

Joined
Jun 19, 2009
Messages
1,538
Reaction score
538
Hi I fixed the swap bug a long time ago it got tested on my server and it worked :thumbup1:
I posted this because someone kinda posted a youtube thingy about it :O.

Find this in DPSrv.cpp @ worldserver
Code:
void CDPSrvr::OnDoEquip( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
{
	DWORD nId;
	int nPart;

	ar >> nId;
	ar >> nPart;		
	
	if( nPart >= MAX_HUMAN_PARTS )	
		return;

	CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );
And put this under it

Code:
#ifdef __QUGET_SWAP_FIX

				if( pUser->GetHitPoint() >  pUser->GetMaxHitPoint() )
					 pUser->SetHitPoint( pUser->GetMaxHitPoint());

				if( pUser->GetManaPoint() >  pUser->GetMaxManaPoint() )
					 pUser->SetManaPoint( pUser->GetMaxManaPoint() );

				if( pUser->GetFatiguePoint() >  pUser->GetMaxFatiguePoint() )
					 pUser->SetFatiguePoint( pUser->GetMaxFatiguePoint() );

#endif
find this in function void CDPClient::OnDoEquip( OBJID objid, CAr & ar ) @ DPClient.cpp
and add under
Code:
if( g_WndMng.m_pWndBeautyShop && g_WndMng.m_pWndBeautyShop->m_pModel )
			{
				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 );
			}
this
Code:
#ifdef __QUGET_SWAP_FIX
				if( pPlayer->GetHitPoint() >  pPlayer->GetMaxHitPoint() )
					 pPlayer->SetHitPoint( pPlayer->GetMaxHitPoint());

				if( pPlayer->GetManaPoint() >  pPlayer->GetMaxManaPoint() )
					 pPlayer->SetManaPoint( pPlayer->GetMaxManaPoint() );

				if( pPlayer->GetFatiguePoint() >  pPlayer->GetMaxFatiguePoint() )
					 pPlayer->SetFatiguePoint( pPlayer->GetMaxFatiguePoint() );

#endif

and then define __QUGET_SWAP_FIX in versioncommon.h @neuz and worldserver
 
Last edited:
how does work this swap works? it block any item usage or block any skill when ur using any skill. or just fix the bug?
 
Idk at my server they said it got fixed.
I don't bug abuse lol so yea...
Let me explain...

if( pUser->GetHitPoint() > pUser->GetMaxHitPoint() )//If users HitPoint is higher then users max hitpoints..
pUser->SetHitPoint( pUser->GetMaxHitPoint());//Set users hitpoints to his max hitpoints
 
Why don't you make just a check in the dmg formula for Psycho Bomb & Asal?

something like that:

PHP:
int AsalFormula ()
{
	int nMana = pUser->GetManaPoint();

	if( nMana > pUser->GetMaxManaPoint() )
		 nMana = pUser->GetMaxManaPoint();

	return nStr*nMana*TheRest;
}
 
Why don't you make just a check in the dmg formula for Psycho Bomb & Asal?

something like that:

PHP:
int AsalFormula ()
{
	int nMana = pUser->GetManaPoint();

	if( nMana > pUser->GetMaxManaPoint() )
		 nMana = pUser->GetMaxManaPoint();

	return nStr*nMana*TheRest;
}
Nha i would rather check when you swap the **** (OnDoEquip)
So other skills wont be effected with the bug.

This should have fixed the swap bug since it didnt work on my server atleast gms/mod/players confirmed it didnt work anymore.
When my server was still running... :ott1:

nvm forgot a piece of code in the client let me update

/updated main post sorry
 
Last edited:
Back