mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- validate actors before processing them in the event queue.
This commit is contained in:
parent
118b3e1d70
commit
2f5be23171
2 changed files with 8 additions and 4 deletions
|
@ -61,11 +61,10 @@ void fxFlameLick(DBloodActor* actor, int) // 0
|
|||
void Remove(DBloodActor* actor, int) // 1
|
||||
{
|
||||
if (!actor) return;
|
||||
spritetype *pSprite = &actor->s();
|
||||
evKillActor(actor, kCallbackFXFlareSpark);
|
||||
if (pSprite->extra > 0)
|
||||
seqKill(3, pSprite->extra);
|
||||
sfxKill3DSound(pSprite, 0, -1);
|
||||
if (actor->hasX())
|
||||
seqKill(actor);
|
||||
sfxKill3DSound(actor, 0, -1);
|
||||
DeleteSprite(actor);
|
||||
}
|
||||
|
||||
|
|
|
@ -630,6 +630,11 @@ void evProcess(unsigned int time)
|
|||
{
|
||||
EVENT event = *queue.begin();
|
||||
queue.erase(queue.begin());
|
||||
if (event.type == SS_SPRITE)
|
||||
{
|
||||
// Don't call events on destroyed actors. Seems to happen occasionally.
|
||||
if (!event.actor || event.actor->s().statnum == kStatFree) continue;
|
||||
}
|
||||
|
||||
if (event.cmd == kCmdCallback)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue