Merge pull request #50456 from Blackiris/fix-extends-parent-relative

Fix extends with relative path to parent script
This commit is contained in:
George Marques 2021-09-15 11:12:24 -03:00 committed by GitHub
commit a5c299630d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -253,6 +253,9 @@ Error GDScriptAnalyzer::resolve_inheritance(GDScriptParser::ClassNode *p_class,
int extends_index = 0;
if (!p_class->extends_path.is_empty()) {
if (p_class->extends_path.is_relative_path()) {
p_class->extends_path = class_type.script_path.get_base_dir().plus_file(p_class->extends_path).simplify_path();
}
Ref<GDScriptParserRef> parser = get_parser_for(p_class->extends_path);
if (parser.is_null()) {
push_error(vformat(R"(Could not resolve super class path "%s".)", p_class->extends_path), p_class);