From 0027c8ded01b0f96f3d302ba02541bb74baa59a6 Mon Sep 17 00:00:00 2001 From: iisaev Date: Sat, 24 Oct 2026 11:29:18 +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 --- test_suites/walk/src/RpgWalkTestInitializer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test_suites/walk/src/RpgWalkTestInitializer.cs b/test_suites/walk/src/RpgWalkTestInitializer.cs index 776492b..0466b87 100644 --- a/test_suites/walk/src/RpgWalkTestInitializer.cs +++ b/test_suites/walk/src/RpgWalkTestInitializer.cs @@ -32,7 +32,7 @@ namespace Cthangover.Mods.Rpg.Tests .Select(a => a.Substring("--shots=".Length)) .FirstOrDefault(); GameLogger.Log("TEST", $"RpgWalkTestInitializer: activating rpg_walk, shots={shots ?? "off"}"); - (Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new RpgWalkTestDriver(shots)); + ModRoot.AddDeferred(new RpgWalkTestDriver(shots)); } } }