From 398433b5e6c76bf08c89e0ac447f887a4a1cc561 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 6 Nov 2016 13:20:22 +0100 Subject: [PATCH] - fixed: Explicit casts to bool were missing. --- src/scripting/codegeneration/codegen.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/scripting/codegeneration/codegen.cpp b/src/scripting/codegeneration/codegen.cpp index ea61d42df..b2d0b2f0a 100644 --- a/src/scripting/codegeneration/codegen.cpp +++ b/src/scripting/codegeneration/codegen.cpp @@ -6083,6 +6083,7 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx) switch (MethodName) { + case NAME_Bool: case NAME_Int: case NAME_uInt: case NAME_Double: @@ -6092,7 +6093,9 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx) case NAME_State: if (CheckArgSize(MethodName, ArgList, 1, 1, ScriptPosition)) { - PType *type = MethodName == NAME_Int ? TypeSInt32 : + PType *type = + MethodName == NAME_Bool ? TypeBool : + MethodName == NAME_Int ? TypeSInt32 : MethodName == NAME_uInt ? TypeUInt32 : MethodName == NAME_Double ? TypeFloat64 : MethodName == NAME_Name ? TypeName :