- RR: fixed crash in function that handles acts of mass destruction (like blowing up gas stations.)

With bad setups 'spr' could be left uninitialized. This crashed E1L1 of 'The Hickston Swamp' mod.
This commit is contained in:
Christoph Oelckers 2021-06-11 23:20:50 +02:00
parent 15635ec7c8
commit 20ca676539

View file

@ -4095,10 +4095,10 @@ void destroyit(DDukeActor *actor)
{
int lotag, hitag;
int wi, wj;
DDukeActor* spr;
int wallstart2, wallend2;
int sectnum;
int wallstart, wallend;
DDukeActor* spr = nullptr;
hitag = 0;
DukeSectIterator it1(actor->s->sectnum);
@ -4128,7 +4128,7 @@ void destroyit(DDukeActor *actor)
}
}
}
if (spr->s->sectnum != it_sect)
if (spr && spr->s->sectnum != it_sect)
if (lotag == a2->s->lotag)
{
sectnum = spr->s->sectnum;