Skip to content

Commit

Permalink
Make StatusUpdate less general
Browse files Browse the repository at this point in the history
If cache is used, status only needs to be set once, no need to check it
every time
  • Loading branch information
blowfishpro committed Sep 23, 2017
1 parent 7e714a4 commit 9236be1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ModuleManager/MMPatchLoader.cs
Expand Up @@ -354,8 +354,6 @@ private IEnumerator ProcessPatch()
LoadCache();
}

StatusUpdate();

logger.Info(status + "\n" + errors);

#if DEBUG
Expand Down Expand Up @@ -735,7 +733,7 @@ private void LoadCache()
ConfigNode cache = ConfigNode.Load(cachePath);

if (cache.HasValue("patchedNodeCount") && int.TryParse(cache.GetValue("patchedNodeCount"), out int patchedNodeCount))
progress.PatchedNodeCount = patchedNodeCount;
status = "ModuleManager: " + patchedNodeCount + " patch" + (patchedNodeCount != 1 ? "es" : "") + " loaded from cache";

// Create the fake file where we load the physic config cache
UrlDir gameDataDir = GameDatabase.Instance.root.AllDirectories.First(d => d.path.EndsWith("GameData") && d.name == "" && d.url == "");
Expand Down Expand Up @@ -765,7 +763,7 @@ private void LoadCache()

private void StatusUpdate()
{
status = "ModuleManager: " + progress.PatchedNodeCount + " patch" + (progress.PatchedNodeCount != 1 ? "es" : "") + (useCache ? " loaded from cache" : " applied");
status = "ModuleManager: " + progress.PatchedNodeCount + " patch" + (progress.PatchedNodeCount != 1 ? "es" : "") + " applied";
progressFraction = progress.ProgressFraction;


Expand Down

0 comments on commit 9236be1

Please sign in to comment.