From 0810e76474d855eeec71f01d9f4174ad0722788c Mon Sep 17 00:00:00 2001 From: Westin Miller Date: Mon, 11 Sep 2017 18:55:09 -0700 Subject: [PATCH] Once the game is created we can patch it with impunity. --- Torch/TorchBase.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Torch/TorchBase.cs b/Torch/TorchBase.cs index 7bf0b18..cb0f9d1 100644 --- a/Torch/TorchBase.cs +++ b/Torch/TorchBase.cs @@ -127,6 +127,13 @@ namespace Torch Managers.AddManager(new FilesystemManager(this)); Managers.AddManager(new UpdateManager(this)); Managers.AddManager(Plugins); + GameStateChanged += (game, state) => + { + if (state != TorchGameState.Created) + return; + // At this point flush the patches; it's safe. + patcher.Commit(); + }; TorchAPI.Instance = this; } @@ -397,7 +404,6 @@ namespace Torch { _gameState = value; GameStateChanged?.Invoke(MySandboxGame.Static, _gameState); - Log.Info($"Game state changed {_gameState}"); } }