mirror of
https://github.com/Outer-Wilds-New-Horizons/new-horizons.git
synced 2025-12-11 20:15:44 +01:00
fixed file extension
This commit is contained in:
parent
c7f12c967b
commit
b3accf459d
@ -25,12 +25,19 @@ 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)
|
||||||
{
|
{
|
||||||
if (writeBeforeUnload) Cache.WriteToFile();
|
if (writeBeforeUnload) Cache?.WriteToFile();
|
||||||
|
|
||||||
Cache = null; // garbage collection will take care of it
|
Cache = null; // garbage collection will take care of it
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user