- fixed and cleaned up state index jump handling

* use the function build list instead of the function to pass the info. The function is permanent so not the best place for compile-time info.
 * pass along the current state index which is needed to calculate the target state.
This commit is contained in:
Christoph Oelckers 2016-11-06 13:14:46 +01:00
commit 2ac0046cda
9 changed files with 24 additions and 18 deletions

View file

@ -2349,8 +2349,8 @@ void ZCCCompiler::CompileStates()
auto code = SetupActionFunction(static_cast<PClassActor *>(c->Type()), sl->Action);
if (code != nullptr)
{
auto funcsym = CreateAnonymousFunction(c->Type(), nullptr, VARF_Method | VARF_Action, (int)sl->Frames->Len());
state.ActionFunc = FunctionBuildList.AddFunction(funcsym, code, FStringf("%s.StateFunction.%d", c->Type()->TypeName.GetChars(), statedef.GetStateCount()), false);
auto funcsym = CreateAnonymousFunction(c->Type(), nullptr, VARF_Method | VARF_Action);
state.ActionFunc = FunctionBuildList.AddFunction(funcsym, code, FStringf("%s.StateFunction.%d", c->Type()->TypeName.GetChars(), statedef.GetStateCount()), false, statedef.GetStateCount(), (int)sl->Frames->Len());
}
}