Add 'float' and 'state' as possible return types for action functions

This commit is contained in:
Randy Heit 2016-02-12 17:21:57 -06:00
parent 45108e9bb8
commit 0f70d10521
2 changed files with 9 additions and 0 deletions

View file

@ -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;

View file

@ -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);