From e081a0d810c8a55fd728eeeb1825b3fe68f1b664 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 17 Sep 2017 11:25:55 +0300 Subject: [PATCH] Fixed crash on attempt to get actor state named 'None' https://forum.zdoom.org/viewtopic.php?t=57885 --- src/p_states.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_states.cpp b/src/p_states.cpp index c1e3e79c2..133ac4ad6 100644 --- a/src/p_states.cpp +++ b/src/p_states.cpp @@ -336,7 +336,7 @@ static bool VerifyJumpTarget(PClassActor *cls, FState *CallingState, int index) FState *FStateLabelStorage::GetState(int pos, PClassActor *cls, bool exact) { - if (pos > 0x10000000) + if (pos >= 0x10000000) { return cls? cls->FindState(ENamedName(pos - 0x10000000)) : nullptr; } @@ -1142,4 +1142,4 @@ DEFINE_ACTION_FUNCTION(FState, ValidateSpriteFrame) { PARAM_SELF_STRUCT_PROLOGUE(FState); ACTION_RETURN_BOOL(self->Frame < sprites[self->sprite].numframes); -} \ No newline at end of file +}