From 1f932937d8a1f4c428b14ed7832363e1e3b94cad Mon Sep 17 00:00:00 2001 From: iisaev Date: Sat, 24 Oct 2026 11:29:15 +0200 Subject: [PATCH] Root nodes join through ModRoot.AddDeferred, so a reload that unloads the mod first never hands Godot a freed node Co-Authored-By: Claude Opus 5.5 --- src/LocaleAtlasInitializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LocaleAtlasInitializer.cs b/src/LocaleAtlasInitializer.cs index bbbee32..099dbb4 100644 --- a/src/LocaleAtlasInitializer.cs +++ b/src/LocaleAtlasInitializer.cs @@ -38,7 +38,7 @@ namespace Cthangover.LocaleAtlas queued = true; var directory = ProjectSettings.GlobalizePath(output); GameLogger.Log("LOCALE_ATLAS", $"locale atlas requested, report directory '{directory}'"); - (Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new LocaleAtlasDriverNode(directory, ParseTimeout(args))); + ModRoot.AddDeferred(new LocaleAtlasDriverNode(directory, ParseTimeout(args))); } private static float ParseTimeout(string[] args)