Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 fixed missing script parent path #383

Merged
merged 5 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions addons/mod_loader/internal/script_extension.gd
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static func apply_extension(extension_path: String) -> Script:
ModLoaderLog.error("The child script path '%s' does not exist" % [extension_path], LOG_NAME)
return null

var child_script: Script = ResourceLoader.load(extension_path)
var child_script: Script = load(extension_path)
# Adding metadata that contains the extension script path
# We cannot get that path in any other way
# Passing the child_script as is would return the base script path
Expand All @@ -112,8 +112,7 @@ static func apply_extension(extension_path: String) -> Script:
# class multiple times.
# This is also needed to make Godot instantiate the extended class
# when creating singletons.
# The actual instance is thrown away.
child_script.new()
child_script.reload()

var parent_script: Script = child_script.get_base_script()
var parent_script_path: String = parent_script.resource_path
Expand Down