From 76ea995228df510bfd4212e29f7cb76f13e25fb5 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Fri, 5 Aug 2016 13:44:12 +0300 Subject: Fix #5891 by not expecting the script instance to be a GDInstance It could be a placeholder instance as well --- modules/gdscript/gd_function.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/gdscript/gd_function.cpp b/modules/gdscript/gd_function.cpp index de86eb2ab9..47d8f0b40f 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(obj_A->get_script_instance()); - GDScript *cmp = ins->script.ptr(); + GDScript *cmp = static_cast(obj_A->get_script_instance()->get_script().ptr()); //bool found=false; while(cmp) { -- cgit v1.2.3