summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2018-07-25 20:38:02 -0300
committerGeorge Marques <george@gmarqu.es>2018-07-25 20:50:13 -0300
commit7db7b43cb0452b02123eeeb8f4370646b31ba8e0 (patch)
tree1c443b0520e4e3c70aa5612cc538660506e53f48
parentaeb0b3114d336958e4e1ab7781022e583ef8fe1d (diff)
GDScript: Fix type detection for String formatting operator
-rw-r--r--modules/gdscript/gdscript_parser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index 225c2736b8..ecaf79d6cd 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);