Func DestroyAllBotsPlayers() causes a CTD + more.

Moderator: NADEO

Locked
Lethan
Posts: 21
Joined: 20 Jun 2013, 16:01

Func DestroyAllBotsPlayers() causes a CTD + more.

Post by Lethan »

Hello guys,

I tried to get what is the reason why we get a Crash To Desktop when we use bots. I founded two situations when it occurs :
- When using function DestroyAllBotsPlayers()
- When stopping a local server BEFORE bots destroyed

Map tested : Horde_Single.Map.Gbx
Script : Horde.Script.txt

Both map and script are available from here : http://files.maniaplanet.com/botdata/BotExample.zip

I have modified this script to temporally fix the DestroyAllBotsPlayers() problem.
Original code
Line 82 :

Code: Select all

Void UnspawnEveryone()
{
   DestroyAllBotPlayers();
	
	foreach(Player in Players) 
	{
		UnspawnPlayer(Player);
	}
}
New code
Line 82 :

Code: Select all

Void UnspawnEveryone()
{
    foreach(Player in BotPlayers)
    {
        DestroyBotPlayer(Player);
    }
   //DestroyAllBotPlayers();
	
	foreach(Player in Players) 
	{
		UnspawnPlayer(Player);
	}
}
This will fix temporally the Crash To Desktop when the map ends.

BUT

The second CrashToDesktop comes when we stop a game from local with the script. The game crashes because bots are not destroyed. You cant test by yourself, in my modified code, if you try to leave before UnspawnEveryone() call, the game will crash. If you leave the local game after the function call, you will be redirected safely to the main menu :D .
Line 390 :

Code: Select all

log("Bots unspawned you can leave without CTD");
sleep(5000);
Sleep function will give you the time to easily stop the local game for testing purposes.

Version française résumée (Short French Version) :
La fonction DestroyAllBotsPlayers() semble causer une fuite RAM et donc un crash to desktop. Utiliser une boucle foreach ainsi que la fonction DestroyPlayer(CSmPlayer player) évite le problème. De plus, si l'on tente de quitter une partie locale alors que des bots sont toujours existants sur la map, un crash se produira.

Thank you for reading this report :thx:

Notice : My english skills are... :mrgreen:
User avatar
spaii
Posts: 1100
Joined: 19 Jun 2010, 00:04
Location: Rémy - France
Contact:

Re: Func DestroyAllBotsPlayers() causes a CTD + more.

Post by spaii »

:thumbsup:
User avatar
Dommy
Translator
Translator
Posts: 1901
Joined: 25 Aug 2011, 21:45
Location: Poland
Contact:

Re: Func DestroyAllBotsPlayers() causes a CTD + more.

Post by Dommy »

Thank You :thx:
Ryzen 7 2700X, GTX 1070 Ti, 16 GB RAM, Windows 10 Insider Build
FORUM MODERATOR • CREATOR OF SHOOTMANIA GALAXY & TRACKMANIA² PURSUIT

Contact me via GALAXY & PURSUIT DISCORD
Locked

Return to “Shootmania Storm Reports”

Who is online

Users browsing this forum: No registered users and 1 guest