[source edit]Swap bug fix

09/25/2011 17:58 darking1assist#1
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
09/25/2011 18:15 MysticAngelz#2
Nice

Sry can everyone explain the swap bug

Kann mir das mal wer erklären?
09/25/2011 18:44 Doomm#3
Schau auf youtube in Video an !
09/25/2011 20:37 -*N1ce.#4
Besser Gesagt auf Deutsch Psy Switch Bug
09/25/2011 21:18 .Tear#5
Nicht nur Psy, sondern auch BP ^^ Bzw jeden Bug. H P Bug etc..
09/26/2011 20:40 darking1assist#6
updated main post forgot the neuz part :P
09/27/2011 01:24 Sedrika#7
Quote:
Originally Posted by darking1assist View Post
updated main post forgot the neuz part :P
If you update the serversided part you dont need the client sided.
09/27/2011 22:04 darking1assist#8
Quote:
Originally Posted by Sedrika View Post
If you update the serversided part you dont need the client sided.
It would be nice to see a non bugged HP bar right ;)
12/12/2011 09:30 clinkz96#9
is this working?
12/12/2011 11:24 Jopsi332#10
Quote:
Originally Posted by clinkz96 View Post
is this working?
yes. it is pretty easy to understand.

b2t
Nice and so easy :D
02/18/2012 07:13 Xefiroid#11
Das funktioniert bei mir nur client side.

Server side bugt die HP/MP/FP noch genau wie vorher, jedoch client side sieht man sie nie "über voll" dennoch kann man troz dieses fixx genau wie zuvor auch buggen.


hat jemand ne andere lösung oder nen fixx? ich habe es jetzt mehrmals ausprobiert und alles kontrolliert, ich bezweifle das ich etwas falsch gemacht habe.
02/18/2012 19:27 Yoshii50000#12
für MP musst du in der attackarbieter die berechnung nur umändern das der wenn man über 100% mp hat trd mit 100% rechnet HP/FP müsste ich auch mal suchen da hab ich mich nie für interessiert
02/18/2012 23:22 Xefiroid#13
Quote:
Originally Posted by Yoshii50000 View Post
für MP musst du in der attackarbieter die berechnung nur umändern das der wenn man über 100% mp hat trd mit 100% rechnet HP/FP müsste ich auch mal suchen da hab ich mich nie für interessiert
wichtig ist mir aber auch die HP.

könntest du mal so ne zeile posten? ich habe leider nicht allzu viel ahnung von c++, einfügen sollte für mich aber kein problem sein^^
02/18/2012 23:53 Yoshii50000#14
Quote:
Originally Posted by Xefiroid View Post
wichtig ist mir aber auch die HP.

könntest du mal so ne zeile posten? ich habe leider nicht allzu viel ahnung von c++, einfügen sollte für mich aber kein problem sein^^
code ist ganz einfach

Code:
	int nMP = m_pAttacker->GetManaPoint();	
	if( nMP > m_pAttacker->GetMaxManaPoint()) 
                   nMP = m_pAttacker->GetMaxManaPoint();
02/19/2012 02:25 yannickFlyff#15
Quote:
Originally Posted by Yoshii50000 View Post
code ist ganz einfach

Code:
	int nMP = m_pAttacker->GetManaPoint();	
	if( nMP > m_pAttacker->GetMaxManaPoint()) 
                   nMP = m_pAttacker->GetMaxManaPoint();
Wieso so unnötig Prüfen?

Einfach in der SetDestParamEquip beim anziehen von zeugs das dir FP MP HP gibt überprüfen ob dieser Wert das maximum übersteigt? ;S

Außerdem liegt das Problem der HPBar (sie ist zu groß) der Speedbug usw.. an ein und der selben sache :)

Kuckt euch mal genau an wie dieser Bug auftrettet und versucht ihn gezielt zu replizieren.
Ihr werdet merken das der Server etwas vergisst zu updaten ;]