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:
1 parent
68ed11cadc
commit
d1b2cae314
3 files changed
+3
-3
No files matched your search
@@ -57,7 +57,7 @@ namespace Cthangover.Mods.Dialog
|
|||||||
|
|
||||||
// Deferred: OnModResourcesReady fires while the root is still
|
// Deferred: OnModResourcesReady fires while the root is still
|
||||||
// setting up autoload children, so a direct AddChild is rejected.
|
// setting up autoload children, so a direct AddChild is rejected.
|
||||||
root.CallDeferred("add_child", new DialogScriptRunner { Name = "DialogRunner" });
|
ModRoot.AddDeferred(new DialogScriptRunner { Name = "DialogRunner" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ namespace Mods.TestRunner
|
|||||||
// Deferred: сцена ещё строится; драйвер внутри сам выдерживает
|
// Deferred: сцена ещё строится; драйвер внутри сам выдерживает
|
||||||
// стартовую паузу и лениво ищет DialogBox, поэтому порядок с
|
// стартовую паузу и лениво ищет DialogBox, поэтому порядок с
|
||||||
// загрузкой сцены не важен.
|
// загрузкой сцены не важен.
|
||||||
root.CallDeferred("add_child", new DialogAutoDriverNode(choices, timeout, dialogs));
|
ModRoot.AddDeferred(new DialogAutoDriverNode(choices, timeout, dialogs));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<int> ParseChoices(string[] args)
|
private static List<int> ParseChoices(string[] args)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace Mods.DialogBase.Tests
|
|||||||
return;
|
return;
|
||||||
queued = true;
|
queued = true;
|
||||||
GameLogger.Log("TEST", "GdscriptTest: activating");
|
GameLogger.Log("TEST", "GdscriptTest: activating");
|
||||||
(Godot.Engine.GetMainLoop() as SceneTree)?.Root?.CallDeferred("add_child", new GdscriptTestDriverNode());
|
ModRoot.AddDeferred(new GdscriptTestDriverNode());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user