Cumulative Ignore/Listen

Oh my goodness. I have to thank you for discovering this. I thought I was being clever by doing this in my code:

on loop do
	// I wonder if this will cause perf issues - maybe i should only check when i need to?
	if event.ra==0 then
		IS_CRANKING = 0
	else
		IS_CRANKING = 1
	end
	
	
	if GAME_OVER==1 then
		tell event.game to
			call "reset"
		end
	end
	
		
	if IGNORE==1 then
		ignore
	else
		listen
	end
// ....

So that I could set IGNORE to 1 or 0 anywhere and handle ignoring / listening in one place. But I had this logic in a loop, so my ignore calls were stacking! I could not for the life of me figure out what was happening.

Cheers!

1 Like