mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-03 10:41:24 +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
|
void Remove(DBloodActor* actor, int) // 1
|
||||||
{
|
{
|
||||||
if (!actor) return;
|
if (!actor) return;
|
||||||
spritetype *pSprite = &actor->s();
|
|
||||||
evKillActor(actor, kCallbackFXFlareSpark);
|
evKillActor(actor, kCallbackFXFlareSpark);
|
||||||
if (pSprite->extra > 0)
|
if (actor->hasX())
|
||||||
seqKill(3, pSprite->extra);
|
seqKill(actor);
|
||||||
sfxKill3DSound(pSprite, 0, -1);
|
sfxKill3DSound(actor, 0, -1);
|
||||||
DeleteSprite(actor);
|
DeleteSprite(actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -630,6 +630,11 @@ void evProcess(unsigned int time)
|
||||||
{
|
{
|
||||||
EVENT event = *queue.begin();
|
EVENT event = *queue.begin();
|
||||||
queue.erase(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)
|
if (event.cmd == kCmdCallback)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue