EntityControlManager partial rewrite to do lazy updating

Auto commit patches once SE instance has been created
This commit is contained in:
Westin Miller
2017-11-01 05:08:17 -07:00
parent 6814a833be
commit c8377b318e
5 changed files with 117 additions and 40 deletions

View File

@@ -260,7 +260,11 @@ namespace Torch
GameStateChanged += (game, state) =>
{
if (state == TorchGameState.Created)
{
ObjectFactoryInitPatch.ForceRegisterAssemblies();
// safe to commit here; all important static ctors have run
PatchManager.CommitInternal();
}
};
Debug.Assert(MyPerGameSettings.BasicGameInfo.GameVersion != null, "MyPerGameSettings.BasicGameInfo.GameVersion != null");
@@ -292,6 +296,10 @@ namespace Torch
Managers.GetManager<PluginManager>().LoadPlugins();
Managers.Attach();
_init = true;
if (GameState >= TorchGameState.Created && GameState < TorchGameState.Unloading)
// safe to commit here; all important static ctors have run
PatchManager.CommitInternal();
}
private void OnSessionLoading()