diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-06-28 11:15:55 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2016-06-28 11:15:55 -0300 |
commit | cf6450043d8815c5708644a097e3af85a1b120b6 (patch) | |
tree | 9222341b763a1d4492387563662b397b85ace9a8 | |
parent | f4c66408276c5eff471d9e945eb02b36e7c71395 (diff) |
Fix bug in inner class reference, closes #1411
-rw-r--r-- | modules/gdscript/gd_script.cpp | 13 |
1 files 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<StringName,Variant>::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<StringName,Variant>::Element *E = sl->constants.find(p_name); + if (E) { + r_ret=E->get(); + return true; //index found + + } + sl=sl->_base; } } |