mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-02 22:01:41 +00:00
- 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:
parent
3724f8a67c
commit
e7f78ce911
2 changed files with 7 additions and 4 deletions
|
@ -4767,10 +4767,7 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
|
|||
PClassActor *type = PClass::FindActor(pufftype);
|
||||
if (type == NULL)
|
||||
{
|
||||
if (victim != NULL)
|
||||
{
|
||||
memset(victim, 0, sizeof(*victim));
|
||||
}
|
||||
if (victim != NULL) *victim = {};
|
||||
Printf("Attempt to spawn unknown actor type '%s'\n", pufftype.GetChars());
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue