- fixed order of state setup.

It looks like the setup of the action function and the adding of the states got inverted by something I tried, leaving the ActionFunc member empty on the real states.
This commit is contained in:
Christoph Oelckers 2016-10-14 21:56:45 +02:00
parent 52005214c1
commit d00e93bdab

View file

@ -2169,13 +2169,6 @@ void ZCCCompiler::CompileStates()
}
#endif
int count = statedef.AddStates(&state, sl->Frames->GetChars());
if (count < 0)
{
Error(sl, "Invalid frame character string '%s'", sl->Frames->GetChars());
count = -count;
}
if (sl->Action != nullptr)
{
auto code = SetupActionFunction(static_cast<PClassActor *>(c->Type()), sl->Action);
@ -2184,6 +2177,13 @@ void ZCCCompiler::CompileStates()
state.ActionFunc = FunctionBuildList.AddFunction(c->Type(), code, FStringf("%s.StateFunction.%d", c->Type()->TypeName.GetChars(), statedef.GetStateCount()), true);
}
}
int count = statedef.AddStates(&state, sl->Frames->GetChars());
if (count < 0)
{
Error(sl, "Invalid frame character string '%s'", sl->Frames->GetChars());
count = -count;
}
break;
}
case AST_StateGoto: