Skip to content

Commit

Permalink
Fixed|Hexen: Avoid crash due to missing actor target
Browse files Browse the repository at this point in the history
It is likely that the target pointer has not been correct restored
from the savegame here, or it was never correctly written.
  • Loading branch information
skyjake committed Jul 26, 2017
1 parent 0ece298 commit ed47b82
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion doomsday/apps/plugins/hexen/src/p_enemy.c
Expand Up @@ -1774,7 +1774,14 @@ void C_DECL A_SpeedFade(mobj_t *actor)
{
actor->flags |= MF_SHADOW;
actor->flags &= ~MF_ALTSHADOW;
actor->sprite = actor->target->sprite;

// Target should have been set (or restored).
DENG_ASSERT(actor->target != NULL);

if (actor->target)
{
actor->sprite = actor->target->sprite;
}
}

/**
Expand Down

0 comments on commit ed47b82

Please sign in to comment.