mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 13:12:42 +00:00
Merge pull request #94802 from Hilderin/fix-autoload-node-cannot-be-accessed-plugin-start-up
Fix autoload node cannot be accessed by plugin on start-up
This commit is contained in:
commit
96be44c0ec
@ -457,7 +457,9 @@ void EditorAutoloadSettings::init_autoloads() {
|
||||
|
||||
for (const AutoloadInfo &info : autoload_cache) {
|
||||
if (info.node && info.in_editor) {
|
||||
callable_mp((Node *)get_tree()->get_root(), &Node::add_child).call_deferred(info.node, false, Node::INTERNAL_MODE_DISABLED);
|
||||
// It's important to add the node without deferring because code in plugins or tool scripts
|
||||
// could use the autoload node when they are enabled.
|
||||
get_tree()->get_root()->add_child(info.node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user