.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > POD-Bot mm > Bug Reports
Bug Reports Post any bug you experience with the latest release of this bot here

Reply
 
Thread Tools
Re: PB crashes after typing "meta unload podbot"
Old
  (#11)
Immortal_BLG
Member
 
Status: Offline
Posts: 171
Join Date: Nov 2007
Location: Russian Federation
Default Re: PB crashes after typing "meta unload podbot" - 13-03-2012

Quote:
Originally Posted by KWo
Why exactly in ServerActivate - there is no need to allocate the memory for the string?
because the function "ServerActivate" is called each time at changelevel that lead to multiple memory allocation for strings, but the function "GameInit" is called only ONCE - and this is what you need.

[EDIT]
Excuse silly me....

I have forgotten that really it is impossible to call function "ALLOC_STRING" before the server wasn't loaded...
So fix is:
Remove code:
Code:
for (unsigned char stringIndex (0u); stringIndex < String_Total; ++stringIndex)
	strings[stringIndex] = const_cast <char *> (STRING (ALLOC_STRING (strings[stringIndex])));
from GameDLLInit and put in to:
Code:
int Spawn (edict_t *pent)
{
	{
		static bool isFirstCall (true);

		if (isFirstCall)
		{
			isFirstCall = false;

			for (unsigned char stringIndex (0u); stringIndex < String_Total; ++stringIndex)
				strings[stringIndex] = const_cast <char *> (STRING (ALLOC_STRING (strings[stringIndex])));
		}
	}
	// ...
}
[/EDIT]

Last edited by Immortal_BLG; 13-03-2012 at 06:26..
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com