Once the game is created we can patch it with impunity.

This commit is contained in:
Westin Miller
2017-09-11 18:55:09 -07:00
parent 57acb274c6
commit 0810e76474

View File

@@ -127,6 +127,13 @@ namespace Torch
Managers.AddManager(new FilesystemManager(this)); Managers.AddManager(new FilesystemManager(this));
Managers.AddManager(new UpdateManager(this)); Managers.AddManager(new UpdateManager(this));
Managers.AddManager(Plugins); 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; TorchAPI.Instance = this;
} }
@@ -397,7 +404,6 @@ namespace Torch
{ {
_gameState = value; _gameState = value;
GameStateChanged?.Invoke(MySandboxGame.Static, _gameState); GameStateChanged?.Invoke(MySandboxGame.Static, _gameState);
Log.Info($"Game state changed {_gameState}");
} }
} }