func_monster_spawner has a telefrag check in the think_mobot function, which checks if there are any damageable entities within 128 units. If there are any, it will delay the check by 1 second and tries again.
However, there's a problem: if this telefrag check finds any entities the first time the object is used, it will crash the game (or at least QuakeSpasm Spiked) with the error PR_ExecuteProgram: NULL function. This is because the next update is scheduled with self.nextthink
self.nextthink = time + 1; //delay the spawn by some amount;
but at this point in the field self.think is not guaranteed to be set, as it is only set at the end of the function.
The bug can be fixed by adding self.think = think_mobot; to the line before the assignment to self.nextthink.
func_monster_spawner
has a telefrag check in thethink_mobot
function, which checks if there are any damageable entities within 128 units. If there are any, it will delay the check by 1 second and tries again.However, there's a problem: if this telefrag check finds any entities the first time the object is used, it will crash the game (or at least QuakeSpasm Spiked) with the error
PR_ExecuteProgram: NULL function
. This is because the next update is scheduled withself.nextthink
but at this point in the field
self.think
is not guaranteed to be set, as it is only set at the end of the function.The bug can be fixed by adding
self.think = think_mobot;
to the line before the assignment toself.nextthink
.