Page 1 of 1

Survival/Horror

Posted: Mon Mar 24, 2008 8:34 pm
by Salombo
Hello
I get this error that's spamming the qconsole log a lot.

while (!level.sh_murderer.sh_ingame) (global/horror.scr, 279)
while (!level.sh_murderer^

^~^~^ Script Error: Field 'sh_ingame' applied to NULL listener


the relevant part of the code is:

Code: Select all

select_murderer:
	if (level.sh_selecting)
		end
	level.sh_selecting = 1
	local.lastmurderer = level.sh_murderer
	local.murderer = local.lastmurderer
murderer_tryagain:
	if ($player.size < 2)
		local.murderer = $player
	else
	{
		while ((local.murderer == local.lastmurderer || local.murderer.dmteam == spectator) && $player.size > 1)
		{
			local.murderer = $player[randomint($player.size) + 1]
			waitframe
		}
	}
	if (local.murderer == NIL || local.murderer == NULL)
	{
		waitframe
		goto murderer_tryagain
	}
	level.sh_murderer = local.murderer
	while (!level.sh_murderer.sh_ingame)
		waitframe
	level.sh_selecting = 0

		//local.murderer join_team spectator
		local.murderer join_team axis
		local.murderer respawn
		waitframe
I was wondering if there was a fix for that. The mod works very well, it's just the spamming part that's a bit annoying. I've fixed a few null listener errors but this one is a bit tricky.

Thanks 8-)

Posted: Thu Mar 27, 2008 1:07 pm
by Salombo
No luck i guess ... was hoping Rookie would have an answer/idea :cry:

Posted: Thu Mar 27, 2008 3:42 pm
by Rookie One.pl
I know this error and to be honest I never understood why it appears at all, since there are checks for local.murder not being NULL or NIL. :? There were numerous things in this mod that worked against logic, I'm afraid.

What you could try is to change this:

Code: Select all

	while (!level.sh_murderer.sh_ingame)
		waitframe
to this:

Code: Select all

	while (1) {
		if (level.sh_murderer.sh_ingame)
			break
		if (!level.sh_murderer)
			goto murderer_tryagain
		waitframe
	}

Posted: Thu Mar 27, 2008 4:28 pm
by Salombo
Ok thanks
Will give it a shot :D

Posted: Thu Mar 27, 2008 8:12 pm
by Rookie One.pl
Lol, why the hell did I write "I'm glad" instead of "I'm afraid"? :?

Tell us if it stopped the error spam or not.