mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
cache now gets written to file when body building is successful
This commit is contained in:
parent
c9e46050d2
commit
c7f12c967b
@ -273,7 +273,7 @@ namespace NewHorizons.Handlers
|
|||||||
Logger.LogError($"Error in event handler for OnPlanetLoaded on body {body.Config.name}: {e}");
|
Logger.LogError($"Error in event handler for OnPlanetLoaded on body {body.Config.name}: {e}");
|
||||||
}
|
}
|
||||||
|
|
||||||
body.UnloadCache();
|
body.UnloadCache(true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,8 +28,10 @@ namespace NewHorizons.Utility
|
|||||||
if (RelativePath != null) Cache = new Cache(RelativePath+".nhcache");
|
if (RelativePath != null) Cache = new Cache(RelativePath+".nhcache");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnloadCache()
|
public void UnloadCache(bool writeBeforeUnload=false)
|
||||||
{
|
{
|
||||||
|
if (writeBeforeUnload) Cache.WriteToFile();
|
||||||
|
|
||||||
Cache = null; // garbage collection will take care of it
|
Cache = null; // garbage collection will take care of it
|
||||||
}
|
}
|
||||||
#endregion Cache
|
#endregion Cache
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user