- fixed: CALL_ACTION always set 3 args, even for normal methods. Also moved this to a sunfunction because the macro created a lot of code.

This commit is contained in:
Christoph Oelckers 2016-11-06 01:34:54 +01:00
parent b59f4e950f
commit c9a96ed0ae
2 changed files with 10 additions and 4 deletions

View file

@ -1034,10 +1034,9 @@ struct AFuncDesc
//#define DECLARE_PARAMINFO AActor *self, AActor *stateowner, FState *CallingState, int ParameterIndex, StateCallData *statecall
//#define PUSH_PARAMINFO self, stateowner, CallingState, ParameterIndex, statecall
#define CALL_ACTION(name,self) { /*AF_##name(self, self, NULL, 0, NULL)*/ \
VMValue params[3] = { self, self, VMValue(NULL, ATAG_GENERIC) }; \
stack->Call(name##_VMPtr, params, countof(params), NULL, 0, NULL); \
}
class AActor;
void CallAction(VMFrameStack *stack, VMFunction *vmfunc, AActor *self);
#define CALL_ACTION(name, self) CallAction(stack, name##_VMPtr, self);
#define ACTION_RETURN_STATE(v) do { FState *state = v; if (numret > 0) { assert(ret != NULL); ret->SetPointer(state, ATAG_STATE); return 1; } return 0; } while(0)

View file

@ -491,3 +491,10 @@ int VMFrameStack::Call(VMFunction *func, VMValue *params, int numparams, VMRetur
throw;
}
}
class AActor;
void CallAction(VMFrameStack *stack, VMFunction *vmfunc, AActor *self)
{
VMValue params[3] = { self, self, VMValue(nullptr, ATAG_GENERIC) };
stack->Call(vmfunc, params, vmfunc->ImplicitArgs, nullptr, 0, nullptr);
}