diff options
| author | Juan Linietsky | 2016-06-28 11:15:55 -0300 |
|---|---|---|
| committer | Rémi Verschelde | 2016-07-08 18:42:07 +0200 |
| commit | de0b7b871b804353daa7bc8fcf557eb0252b8ab7 (patch) | |
| tree | 4664094d1808133d6a1b195459807751205f5148 /modules/gdscript/gd_script.cpp | |
| parent | eaca35adfe30cef5aaaa0f504501f7f2fffcf569 (diff) | |
| download | godot-de0b7b871b804353daa7bc8fcf557eb0252b8ab7.tar.gz godot-de0b7b871b804353daa7bc8fcf557eb0252b8ab7.tar.zst godot-de0b7b871b804353daa7bc8fcf557eb0252b8ab7.zip | |
Fix bug in inner class reference, closes #1411
(cherry picked from commit cf6450043d8815c5708644a097e3af85a1b120b6)
Diffstat (limited to '')
| -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 b9d5910ea..fe26dca23 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<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; } } |
