summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2015-03-22 15:03:32 -0300
committerJuan Linietsky <reduzio@gmail.com>2015-03-22 15:03:32 -0300
commit0302ea5b821939c68529195d223c35bc7f3ce7b1 (patch)
tree762bf92595b88d67c7ddade880942574eac37d7d /modules/gdscript
parent7436f0bb37b43d39ac7b7c72d7761e089b8bdc02 (diff)
parent748311ec42b6818f5481ad4ac4152f40ff1a8a6f (diff)
Merge pull request #1396 from Spooner/fix_sprintf_errors
Fix sprintf errors
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gd_script.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp
index d3a9abf4b7..06c746c4fb 100644
--- a/modules/gdscript/gd_script.cpp
+++ b/modules/gdscript/gd_script.cpp
@@ -337,9 +337,10 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
Variant::evaluate(op,*a,*b,*dst,valid);
if (!valid) {
- if (false && dst->get_type()==Variant::STRING) {
+ if (dst->get_type()==Variant::STRING) {
//return a string when invalid with the error
err_text=*dst;
+ err_text += " in operator '"+Variant::get_operator_name(op)+"'.";
} else {
err_text="Invalid operands '"+Variant::get_type_name(a->get_type())+"' and '"+Variant::get_type_name(b->get_type())+"' in operator '"+Variant::get_operator_name(op)+"'.";
}