- changed action function interface so that callers can be identified directly, instead of guessing it from looking at the parameters.

With arbitrary PSP layers the old method was no longer safe because the layer ID was not available in the action function.
This commit is contained in:
Christoph Oelckers 2016-06-16 16:11:00 +02:00
commit cfaa3e3fa9
9 changed files with 54 additions and 32 deletions

View file

@ -69,14 +69,14 @@ void FState::SetAction(const char *name)
ActionFunc = FindGlobalActionFunction(name)->Variants[0].Implementation;
}
bool FState::CallAction(AActor *self, AActor *stateowner, FState **stateret)
bool FState::CallAction(AActor *self, AActor *stateowner, FStateParamInfo *info, FState **stateret)
{
if (ActionFunc != NULL)
{
ActionCycles.Clock();
static VMFrameStack stack;
VMValue params[3] = { self, stateowner, VMValue(this, ATAG_STATE) };
VMValue params[3] = { self, stateowner, VMValue(info, ATAG_STATEINFO) };
// If the function returns a state, store it at *stateret.
// If it doesn't return a state but stateret is non-NULL, we need
// to set *stateret to NULL.