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 <noreply@anthropic.com>
This commit is contained in:
cthangoverandClaude Opus 5.5 committed 2026-10-24 11:29:19 +02:00
1 parent 4c5454d061
commit 00376b0fe7
1 file changed
+1 -1
@@ -26,7 +26,7 @@ namespace Cthangover.Mods.RpgPlus.Tests
.Select(a => a.Substring("--shots=".Length)) .Select(a => a.Substring("--shots=".Length))
.FirstOrDefault(); .FirstOrDefault();
GameLogger.Log("TEST", $"RpgPlusTestInitializer: activating rpg_plus, shots={shots ?? "off"}"); GameLogger.Log("TEST", $"RpgPlusTestInitializer: activating rpg_plus, shots={shots ?? "off"}");
(Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new RpgPlusTestDriver(shots)); ModRoot.AddDeferred(new RpgPlusTestDriver(shots));
} }
} }
} }