You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Merge pull request #63512 from MmAaXx500/autoload-double-add-remove
Prevent autoloads from being added or removed twice
This commit is contained in:
@@ -541,8 +541,6 @@ void EditorAutoloadSettings::update_autoload() {
|
|||||||
info.node->queue_free();
|
info.node->queue_free();
|
||||||
info.node = nullptr;
|
info.node = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectSettings::get_singleton()->remove_autoload(info.name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load new/changed autoloads
|
// Load new/changed autoloads
|
||||||
@@ -567,12 +565,6 @@ void EditorAutoloadSettings::update_autoload() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectSettings::AutoloadInfo prop_info;
|
|
||||||
prop_info.name = info->name;
|
|
||||||
prop_info.path = info->path;
|
|
||||||
prop_info.is_singleton = info->is_singleton;
|
|
||||||
ProjectSettings::get_singleton()->add_autoload(prop_info);
|
|
||||||
|
|
||||||
if (!info->in_editor && !info->is_singleton) {
|
if (!info->in_editor && !info->is_singleton) {
|
||||||
// No reason to keep this node
|
// No reason to keep this node
|
||||||
memdelete(info->node);
|
memdelete(info->node);
|
||||||
|
|||||||
Reference in New Issue
Block a user