aboutsummaryrefslogtreecommitdiff
path: root/modules/gdscript/gd_function.cpp
diff options
context:
space:
mode:
authorBojidar Marinov2016-08-05 13:44:12 +0300
committerRémi Verschelde2016-08-08 18:14:44 +0200
commitf25e9a08e1f11d2d9036f10324ec0792957938ff (patch)
tree4e1cf7f7c47e33ac48480192f7bc0c8d790755f0 /modules/gdscript/gd_function.cpp
parent4f8f9a4dbf97aace22ad752f5a9d5d32fab95dbd (diff)
downloadgodot-f25e9a08e1f11d2d9036f10324ec0792957938ff.tar.gz
godot-f25e9a08e1f11d2d9036f10324ec0792957938ff.tar.zst
godot-f25e9a08e1f11d2d9036f10324ec0792957938ff.zip
Fix #5891 by not expecting the script instance to be a GDInstance
It could be a placeholder instance as well (cherry picked from commit 76ea995228df510bfd4212e29f7cb76f13e25fb5)
Diffstat (limited to 'modules/gdscript/gd_function.cpp')
-rw-r--r--modules/gdscript/gd_function.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp
index de86eb2ab..47d8f0b40 100644
--- a/modules/gdscript/gd_function.cpp
+++ b/modules/gdscript/gd_function.cpp
@@ -372,8 +372,7 @@ Variant GDFunction::call(GDInstance *p_instance, const Variant **p_args, int p_a
if (obj_A->get_script_instance() && obj_A->get_script_instance()->get_language()==GDScriptLanguage::get_singleton()) {
- GDInstance *ins = static_cast<GDInstance*>(obj_A->get_script_instance());
- GDScript *cmp = ins->script.ptr();
+ GDScript *cmp = static_cast<GDScript*>(obj_A->get_script_instance()->get_script().ptr());
//bool found=false;
while(cmp) {