Fixed potential crash during state validation

https://forum.zdoom.org/viewtopic.php?t=57116

The problem was caused by missing state label in conjunction with incomplete class

actor A : ArmorBonus
{
    Inventory.ForbiddenTo "Missing"
}

actor B : Pistol
{
    states
    {
        TNT1 A 0
        Loop
    }
}
This commit is contained in:
alexey.lysiuk 2018-03-01 11:08:38 +02:00
parent bba3027d37
commit 711471e9dd

View file

@ -344,7 +344,7 @@ public:
bool OwnsState(const FState *state)
{
auto i = ActorInfo();
return state >= i->OwnedStates && state < i->OwnedStates + i->NumOwnedStates;
return i != nullptr && state >= i->OwnedStates && state < i->OwnedStates + i->NumOwnedStates;
}
PClassActor *GetReplacement(bool lookskill=true);