- SW: added a double deletion guard to KillBreakSprite.

This code can easily run into the case where SpawnShrap kills the actor but then further operations are performed, including deleting it again.
This commit is contained in:
Christoph Oelckers 2022-01-03 12:25:38 +01:00
parent be92d252ff
commit 9f83fd3575

View file

@ -808,6 +808,11 @@ bool HitBreakWall(walltype* wp, int hit_x, int hit_y, int hit_z, int ang, int ty
int KillBreakSprite(DSWActor* breakActor)
{
// Double deletion can easily happen with the break sprite code.
if (breakActor->ObjectFlags & OF_EuthanizeMe)
return false;
// Does not actually kill the sprite so it will be valid for the rest
// of the loop traversal.