GDScript: Fix type detection for String formatting operator

This commit is contained in:
George Marques 2018-07-25 20:38:02 -03:00
parent aeb0b3114d
commit 7db7b43cb0
No known key found for this signature in database
GPG key ID: 046BD46A3201E43D

View file

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