fix bad assert in GetStateLabelIndex.

This commit is contained in:
Professor Hastig 2024-04-08 10:13:47 +02:00 committed by Christoph Oelckers
parent 0c5780cc41
commit 6777423d23

View file

@ -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;
}
//==========================================================================