Skip to content

Commit

Permalink
fix bad assert in GetStateLabelIndex.
Browse files Browse the repository at this point in the history
  • Loading branch information
prof-hastig committed Apr 8, 2024
1 parent 7a43d7f commit d5c38b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/p_states.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,10 @@ int FStateDefinitions::GetStateLabelIndex (FName statename)
{
return -1;
}
assert((size_t)std->State <= StateArray.Size() + 1);
return (int)((ptrdiff_t)std->State - 1);
if ((size_t)std->State <= StateArray.Size() + 1)
return (int)((ptrdiff_t)std->State - 1);
else
return -1;
}

//==========================================================================
Expand Down

0 comments on commit d5c38b5

Please sign in to comment.