diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 40cd68b6f2..19e9d4a969 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -6757,3 +6757,48 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FaceMovementDirection) } ACTION_RETURN_BOOL(true); } + +//=========================================================================== +// +// A_State +// +// Returns the state passed in. +// +//=========================================================================== + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_State) +{ + PARAM_ACTION_PROLOGUE; + PARAM_STATE(returnme); + ACTION_RETURN_STATE(returnme); +} + +//=========================================================================== +// +// A_Int +// +// Returns the int passed in. +// +//=========================================================================== + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Int) +{ + PARAM_ACTION_PROLOGUE; + PARAM_INT(returnme); + ACTION_RETURN_INT(returnme); +} + +//=========================================================================== +// +// A_Bool +// +// Returns the bool passed in. +// +//=========================================================================== + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Bool) +{ + PARAM_ACTION_PROLOGUE; + PARAM_BOOL(returnme); + ACTION_RETURN_BOOL(returnme); +} diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index 4774ac9d10..daff4a99ba 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -494,6 +494,10 @@ static void ParseNativeFunction(FScanner &sc, PClassActor *cls) rets.Push(TypeFixed); break; + case TK_State: + rets.Push(TypeState); + break; + case TK_Identifier: rets.Push(NewPointer(RUNTIME_CLASS(DObject))); // Todo: Object type diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 5b0f3a2de3..54bc6c07cf 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -332,6 +332,10 @@ ACTOR Actor native //: Thinker action native int ACS_NamedExecuteWithResult(name script, int arg1=0, int arg2=0, int arg3=0, int arg4=0); action native ACS_NamedExecuteAlways(name script, int mapnum=0, int arg1=0, int arg2=0, int arg3=0); + native state A_State(state returnme); + native int A_Int(int returnme); + native bool A_Bool(bool returnme); + States { Spawn: