- moved OwnedStates and NumOwnedStates out of PClassActor.

This commit is contained in:
Christoph Oelckers 2017-04-11 22:44:35 +02:00
commit 4afe2d4218
11 changed files with 37 additions and 41 deletions

View file

@ -353,13 +353,13 @@ static void CheckStates(PClassActor *obj)
{
CheckStateLabels(obj, pickupstates, SUF_ITEM, "CustomInventory state chain");
}
for (int i = 0; i < obj->NumOwnedStates; i++)
for (int i = 0; i < obj->ActorInfo()->NumOwnedStates; i++)
{
auto state = obj->OwnedStates + i;
auto state = obj->ActorInfo()->OwnedStates + i;
if (state->NextState && (state->UseFlags & state->NextState->UseFlags) != state->UseFlags)
{
GetStateSource(state).Message(MSG_ERROR, TEXTCOLOR_RED "State %s.%d links to a state with incompatible restrictions.\n",
obj->TypeName.GetChars(), int(state - obj->OwnedStates));
GetStateSource(state).Message(MSG_ERROR, TEXTCOLOR_RED "State %s links to a state with incompatible restrictions.\n",
FState::StaticGetStateName(state));
}
}
}