diff options
author | Dani Frank <pdaniq@gmail.com> | 2020-01-18 11:55:27 +0200 |
---|---|---|
committer | Dani Frank <pdaniq@gmail.com> | 2020-01-18 11:55:27 +0200 |
commit | 8f5e424c66f6db6e5726550ec90303ed2c594797 (patch) | |
tree | 26ee4a700c90bb618646bd680a81707c19c00be9 /modules/gdscript | |
parent | f6a02b881afbd1c46a25bd06eeae709de2e1a6ab (diff) |
Fix subclass finding in extend statement for sub-sub classes
lookup was always done on top level script instead of advancing to subclass each time.
this commit changes the lookup to always be at last found subclass
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index 5c2e7137bf..aec7110ee5 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -5404,12 +5404,12 @@ void GDScriptParser::_determine_inheritance(ClassNode *p_class, bool p_recursive ident += ("." + subclass); - if (base_script->get_subclasses().has(subclass)) { + if (find_subclass->get_subclasses().has(subclass)) { - find_subclass = base_script->get_subclasses()[subclass]; - } else if (base_script->get_constants().has(subclass)) { + find_subclass = find_subclass->get_subclasses()[subclass]; + } else if (find_subclass->get_constants().has(subclass)) { - Ref<GDScript> new_base_class = base_script->get_constants()[subclass]; + Ref<GDScript> new_base_class = find_subclass->get_constants()[subclass]; if (new_base_class.is_null()) { _set_error("Constant isn't a class: " + ident, p_class->line); return; |