[HELP] Guild Siege Limit Speed

06/02/2020 06:21 iiamevan#1
Can someone teach me how to limit speed when guild siege.

Thanks by the way :handsdown:
06/02/2020 14:33 Drabur#2
Look at CMover::GetSpeed there you can check the map id and limit the speed
06/02/2020 16:50 Leese#3
VersionCommon.h of Neuz & Worldserver define -> __MAX_SPEED

Inside CMover::GetSpeed
Under
Code:
	if (nAdjValue != 0)
	{
Place
Code:
#ifdef	__MAX_SPEED
			if (GetWorld() && (GetWorld()->GetID() == WI_WORLD_GUILDWAR))
			{
				if (nAdjValue > 100 && IsPlayer()) // 100% Speed Cap in Siege
					nAdjValue = 100;
			}
			else {
				if (nAdjValue > 200 && IsPlayer()) //200% Speed Other Worlds
					nAdjValue = 200;
			}
#endif	//__MAX_SPEED
06/02/2020 20:53 QuietSmoke#4
Quote:
Originally Posted by Leese View Post
VersionCommon.h of Neuz & Worldserver define -> __MAX_SPEED

Inside CMover::GetSpeed
Under
Code:
	if (nAdjValue != 0)
	{
Place
Code:
#ifdef	__MAX_SPEED
			if (GetWorld() && (GetWorld()->GetID() == WI_WORLD_GUILDWAR))
			{
				if (nAdjValue > 100 && IsPlayer()) // 100% Speed Cap in Siege
					nAdjValue = 100;
			}
			else {
				if (nAdjValue > 200 && IsPlayer()) //200% Speed Other Worlds
					nAdjValue = 200;
			}
#endif	//__MAX_SPEED
2 times to call a function, why?

Code:
#ifdef __MAX_SPEED
		CWorld* pWorld = GetWorld();
		if (pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR)
		{
			if(nAdjValue > 100 && IsPlayer()) // 100% Speed Cap in Siege
				nAdjValue = 100;
		}
		else
		{
			if(nAdjValue > 200 && IsPlayer()) //200% Speed Other Worlds
				nAdjValue = 200;
		}
#endif
06/02/2020 22:10 Leese#5
Quote:
Originally Posted by QuietSmoke View Post
2 times to call a function, why?

Code:
#ifdef __MAX_SPEED
		CWorld* pWorld = GetWorld();
		if (pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR)
		{
			if(nAdjValue > 100 && IsPlayer()) // 100% Speed Cap in Siege
				nAdjValue = 100;
		}
		else
		{
			if(nAdjValue > 200 && IsPlayer()) //200% Speed Other Worlds
				nAdjValue = 200;
		}
#endif
Thats better yeah :) Thanks!
06/02/2020 23:08 Drabur#6
Quote:
Originally Posted by QuietSmoke View Post
2 times to call a function, why?

Code:
#ifdef __MAX_SPEED
		CWorld* pWorld = GetWorld();
		if (pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR)
		{
			if(nAdjValue > 100 && IsPlayer()) // 100% Speed Cap in Siege
				nAdjValue = 100;
		}
		else
		{
			if(nAdjValue > 200 && IsPlayer()) //200% Speed Other Worlds
				nAdjValue = 200;
		}
#endif
wow that just makes absolutely no difference
06/03/2020 01:58 QuietSmoke#7
Quote:
Originally Posted by Drabur View Post
wow that just makes absolutely no difference
If this does not matter to you, then no one forces you to install more optimized code:)
06/03/2020 10:49 Drabur#8
Quote:
Originally Posted by QuietSmoke View Post
If this does not matter to you, then no one forces you to install more optimized code:)

"optimized"
if you want to optimize flyff open visual studio and create a new project and start reprogramming the game
06/03/2020 12:00 QuietSmoke#9
Quote:
Originally Posted by Drabur View Post
"optimized"
if you want to optimize flyff open visual studio and create a new project and start reprogramming the game
And why embed even more non-optimized code?:confused:
The game already lags on powerful PCs
Let’s write in such a way that the game of 2008 doesn’t work even on the i9-9900k
06/03/2020 12:02 Drabur#10
It is true that you tries to optimize code, but it is questionable whether the code will ever be used in a public server.
06/03/2020 13:12 QuietSmoke#11
Quote:
Originally Posted by Drabur View Post
It is true that you tries to optimize code, but it is questionable whether the code will ever be used in a public server.
Any optimization makes sense.
And to install more optimized code or not, everyone’s choice;)
06/04/2020 15:36 Blauflosh#12
Quote:
Originally Posted by QuietSmoke View Post
Any optimization makes sense.
And to install more optimized code or not, everyone’s choice;)
GetWorld is most likely getting inlined anyway, you're not optimizing anything at all.