From de0b7b871b804353daa7bc8fcf557eb0252b8ab7 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 28 Jun 2016 11:15:55 -0300 Subject: [PATCH] Fix bug in inner class reference, closes #1411 (cherry picked from commit cf6450043d8815c5708644a097e3af85a1b120b6) --- 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 b9d5910ea7e..fe26dca23da 100644 --- a/modules/gdscript/gd_script.cpp +++ b/modules/gdscript/gd_script.cpp @@ -2278,11 +2278,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; } }