From 7db7b43cb0452b02123eeeb8f4370646b31ba8e0 Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 25 Jul 2018 20:38:02 -0300 Subject: [PATCH] GDScript: Fix type detection for String formatting operator --- modules/gdscript/gdscript_parser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 225c2736b8b..ecaf79d6cdd 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -5438,6 +5438,9 @@ GDScriptParser::DataType GDScriptParser::_get_operation_type(const Variant::Oper if (b_type == Variant::INT || b_type == Variant::REAL) { Variant::evaluate(Variant::OP_ADD, b, 1, b, r_valid); } + if (a_type == Variant::STRING) { + a = "%s"; // Work around for formatting operator (%) + } Variant ret; Variant::evaluate(p_op, a, b, ret, r_valid);