mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
- 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:
parent
52005214c1
commit
d00e93bdab
1 changed files with 7 additions and 7 deletions
|
@ -2169,13 +2169,6 @@ void ZCCCompiler::CompileStates()
|
||||||
}
|
}
|
||||||
#endif
|
#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)
|
if (sl->Action != nullptr)
|
||||||
{
|
{
|
||||||
auto code = SetupActionFunction(static_cast<PClassActor *>(c->Type()), sl->Action);
|
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);
|
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;
|
break;
|
||||||
}
|
}
|
||||||
case AST_StateGoto:
|
case AST_StateGoto:
|
||||||
|
|
Loading…
Reference in a new issue