Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » FDS Crash
Re: FDS Crash [message #484488 is a reply to message #484487] Mon, 18 November 2013 15:32 Go to previous messageGo to previous message
Neijwiert is currently offline  Neijwiert
Messages: 124
Registered: October 2009
Karma:
Recruit
After some more digging I found out that the problem lays at this method:

void NTCPlayerControl::Remove_Excess_Scripts(GameObject *Obj)
{
	if(!Obj)
		return;

	// Loop trough all the scripts
	SimpleDynVecClass<GameObjObserverClass *> Observers = Obj->Get_Observers();
	int Count = Observers.Count();
	for(int x = 0; x < Count; x++)
	{
		GameObjObserverClass *Current = Observers[x];
		if(Current)
		{
			WideStringClass Name = Current->Get_Name();

			if(Name.Compare(L"M00_GrantPowerup_Created") == 0 || Name.Substring(0, 4).Compare_No_Case(L"SSGM") == 0)
			{
				COutput("Should remove: %s\n", Current->Get_Name());
				//Obj->Remove_Observer(Current);
			}
		}
	}
}


As soon as I add the Obj->Remove_Observer line it starts crashing again. But I still haven't figured out why I cant add that line.

UPDATE:
I think somewhere in Scripts.dll there is code that assumes that all SSGM scripts are still attached.

I've changed the code to this to make sure the comparing is going right:

if(Current)
		{
			const char *ScriptName = Current->Get_Name();

			//Name.Substring(0, 4).Compare_No_Case(L"SSGM") == 0
			if(strcmp(ScriptName, "M00_GrantPowerup_Created") == 0 || (ScriptName && strlen(ScriptName) >= 4 && ScriptName[0] == 'S' && ScriptName[1] == 'S' && ScriptName[2] == 'G' && ScriptName[3] == 'M'))
			{
				COutput("Should remove: %s\n", Current->Get_Name());
				Obj->Remove_Observer(Current);
			}
		}

[Updated on: Mon, 18 November 2013 15:42]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Did TT make any changes to Flamers vs Infantry?
Next Topic: 4.0 Server settings question
Goto Forum:
  


Current Time: Mon Dec 23 02:36:43 MST 2024

Total time taken to generate the page: 0.00692 seconds