yquake2/rogue

[Bug] map biggun crashes when self-destruct button is pressed (fix suggestion included)

Closed this issue · 0 comments

This only happens in rogue because of rogue-specific code added to G_UseTargets for cleaning up team chains on killtarget. The while-loop that starts at line 329 does not check for NULL value on master, the loop only stops when done is set to true, in other words the programmer assumed the entity was always present inside the team chain.

I'm not sure what exactly causes the team chain to get into this state. It may be some bad entity teaming in the map itself or the entity was previously removed from its team chain elsewhere in the code but was not freed by G_FreeEdict.

I suggest removing the done variable entirely and replacing "while (!done)" with "while (master)" and replacing "done = true;" with "break;".