- handle cases of empty state labels in ZScript.

Sadly this cannot print a full error message because it got no context for it when it is detected.
This commit is contained in:
Christoph Oelckers 2022-04-15 22:24:34 +02:00
commit e7f78ce911
2 changed files with 7 additions and 4 deletions

View file

@ -318,6 +318,12 @@ static void CheckLabel(PClassActor *obj, FStateLabel *slb, int useflag, FName st
auto state = slb->State;
if (state != nullptr)
{
if (intptr_t(state) <= 0xffff)
{
// can't do much here aside from printing a message and aborting.
I_Error("Bad state label %s in actor %s", slb->Label.GetChars(), obj->TypeName.GetChars());
}
if (!(state->UseFlags & useflag))
{
GetStateSource(state).Message(MSG_ERROR, TEXTCOLOR_RED "%s references state %s as %s state, but this state is not flagged for use as %s.\n",