summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_analyzer.cpp
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-09-15 11:12:24 -0300
committerGitHub <noreply@github.com>2021-09-15 11:12:24 -0300
commita5c299630d865ca61a1943c9ce38936f9ac18063 (patch)
tree579a3cec9d51469b3aa2cb2b72e8a0022882efaf /modules/gdscript/gdscript_analyzer.cpp
parent5a612d61b9a08e58d2b2b440c75b09ba3f5cbad5 (diff)
parenta92d2c447bf6cbe926081ff5e3070ab037237c95 (diff)
downloadredot-engine-a5c299630d865ca61a1943c9ce38936f9ac18063.tar.gz
Merge pull request #50456 from Blackiris/fix-extends-parent-relative
Fix extends with relative path to parent script
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r--modules/gdscript/gdscript_analyzer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp
index e3639cf6fb..e785151a6b 100644
--- a/modules/gdscript/gdscript_analyzer.cpp
+++ b/modules/gdscript/gdscript_analyzer.cpp
@@ -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);