From 0f70d10521d766a0ee4f109bc43793304e9414d7 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 12 Feb 2016 17:21:57 -0600 Subject: [PATCH] Add 'float' and 'state' as possible return types for action functions --- src/thingdef/thingdef_expression.cpp | 1 + src/thingdef/thingdef_parse.cpp | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 987a9806e6..0d6e009fd4 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -3147,6 +3147,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx) else if (rets[0] == TypeFloat64) ValueType = VAL_Float; else if (rets[0] == TypeAngle) ValueType = VAL_Angle; else if (rets[0] == TypeFixed) ValueType = VAL_Fixed; + else if (rets[0] == TypeState) ValueType = VAL_State; else { ValueType = VAL_Int; diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index 93a1398504..255e2adafb 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -1040,6 +1040,14 @@ static void ParseActionDef (FScanner &sc, PClassActor *cls) { rets.Push(TypeSInt32); } + else if (sc.CheckToken(TK_State)) + { + rets.Push(TypeState); + } + else if (sc.CheckToken(TK_Float)) + { + rets.Push(TypeFloat64); + } sc.MustGetToken(TK_Identifier); funcname = sc.String; ParseFunctionDef(sc, cls, funcname, rets, VARF_Method | VARF_Action);