Merge branch 'caching' into auto-spiral-placement-2-electric-boogaloo

This commit is contained in:
FreezeDriedMangoes 2023-01-31 15:11:43 -05:00
commit 57b4f32bbc

View File

@ -25,7 +25,14 @@ namespace NewHorizons.Utility
#region Cache #region Cache
public void LoadCache() public void LoadCache()
{ {
if (RelativePath != null) Cache = new Cache(RelativePath+".nhcache"); if (RelativePath == null)
{
Logger.LogWarning("Cannot load cache! RelativePath is null!");
return;
}
var pathWithoutExtension = RelativePath.Substring(0, RelativePath.LastIndexOf('.'));
Cache = new Cache(pathWithoutExtension+".nhcache");
} }
public void UnloadCache(bool writeBeforeUnload=false) public void UnloadCache(bool writeBeforeUnload=false)