Merge branch 'fix-remove-source-damage' into 'next'

Fix segfault when removing source from ShouldDamage

See merge request STJr/SRB2!1967
This commit is contained in:
sphere 2023-05-01 21:17:01 +00:00
commit 5995c100b6

View file

@ -3546,6 +3546,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
UINT8 shouldForce = LUA_HookShouldDamage(target, inflictor, source, damage, damagetype);
if (P_MobjWasRemoved(target))
return (shouldForce == 1); // mobj was removed
if (P_MobjWasRemoved(source))
source = NULL;
if (shouldForce == 1)
force = true;
else if (shouldForce == 2)