Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Under the right conditions - cooperative game, friendly fire disabled through dmflags - a soldier accidentally shooting a corpse (misc_deadsoldier) caused that corpse to try and fight back. But corpses don't have any AI functions assigned, so that caused the server to execute code at null address. More technically, the T_Damage function is called with targ=dead and attacker=monster. The "friendly fire avoidance" code sets damage=0. Then the "do the damage" code is skipped because of that, and the function continues to execute assuming that the target is alive, and calls M_ReactToDamage on it. That function calls FoundTarget and HuntTarget, and the latter crashes. I'm not entirely certain that this is the right way to fix this, or skipping the call to T_Damage on zero damage would be better. That would prevent pointless monster infights in no-friendly-fire mode. Or is it better to still allow monster infights when friendly fire is disabled?
- Loading branch information