aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_function.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2016-06-11 19:43:38 -0300
committerJuan Linietsky2016-06-11 19:43:38 -0300
commitf860915ae0a1f09ff554a0b37777a57fc6e29ece (patch)
tree1279ced9985e70ec69a3bdf788b9f1c8947c2443 /modules/gdscript/gd_function.cpp
parentd5e2b59c84d8cc60dd042c1567cd1d74a654dc6e (diff)
downloadgodot-f860915ae0a1f09ff554a0b37777a57fc6e29ece.tar.gz
godot-f860915ae0a1f09ff554a0b37777a57fc6e29ece.tar.zst
godot-f860915ae0a1f09ff554a0b37777a57fc6e29ece.zip
Diffstat (limited to 'modules/gdscript/gd_function.cpp')
-rw-r--r--modules/gdscript/gd_function.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index 04522aadc..9d438998c 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -727,7 +727,12 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
String methodstr = GDFunctions::get_func_name(func);
- err_text=_get_call_error(err,"built-in function '"+methodstr+"'",(const Variant**)argptrs);
+ if (dst->get_type()==Variant::STRING) {
+ //call provided error string
+ err_text="Error calling built-in function '"+methodstr+"': "+String(*dst);
+ } else {
+ err_text=_get_call_error(err,"built-in function '"+methodstr+"'",(const Variant**)argptrs);
+ }
break;
}
ip+=argc+1;