diff options
author | George Marques <george@gmarqu.es> | 2019-01-17 16:19:12 -0200 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2019-01-23 17:42:06 -0200 |
commit | f4546fc0cdd64776f5214c3bd9b084cfda39d3d2 (patch) | |
tree | 8d0548041c973b18b3058539e92c95b3ce69a9cb /modules | |
parent | ba13aae9af5c0996ff49bb2b6bbaec2f17039b4a (diff) |
GDScript: don't allow calling non-static function from script
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 9d263aa5e1..ae70525de5 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -642,7 +642,8 @@ Variant GDScript::call(const StringName &p_method, const Variant **p_args, int p if (E) { if (!E->get()->is_static()) { - WARN_PRINT(String("Can't call non-static function: '" + String(p_method) + "' in script.").utf8().get_data()); + ERR_EXPLAIN("Can't call non-static function: '" + String(p_method) + "' in script."); + ERR_FAIL_V(Variant()); } return E->get()->call(NULL, p_args, p_argcount, r_error); |