From cf6450043d8815c5708644a097e3af85a1b120b6 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 28 Jun 2016 11:15:55 -0300 Subject: Fix bug in inner class reference, closes #1411 --- modules/gdscript/gd_script.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/gdscript/gd_script.cpp b/modules/gdscript/gd_script.cpp index 99f349def5..d9783c218a 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -964,11 +964,16 @@ bool GDInstance::get(const StringName& p_name, Variant &r_ret) const { } { - const Map::Element *E = script->constants.find(p_name); - if (E) { - r_ret=E->get(); - return true; //index found + const GDScript *sl = sptr; + while(sl) { + const Map::Element *E = sl->constants.find(p_name); + if (E) { + r_ret=E->get(); + return true; //index found + + } + sl=sl->_base; } } -- cgit v1.2.3