Fix issue with reverted IMC edits and change counter on disabling mods.

This commit is contained in:
Ottermandias 2023-05-12 00:54:47 +02:00
parent 3f03712e24
commit 0aa74692a8
4 changed files with 14 additions and 9 deletions

View file

@ -27,7 +27,10 @@ public class CollectionCacheManager : IDisposable
internal readonly MetaFileManager MetaFileManager;
public int Count { get; private set; }
private int _count;
public int Count
=> _count;
public IEnumerable<ModCollection> Active
=> _storage.Where(c => c.HasCache);
@ -78,7 +81,8 @@ public class CollectionCacheManager : IDisposable
return false;
collection._cache = new CollectionCache(this, collection);
++Count;
if (collection.Index > 0)
Interlocked.Increment(ref _count);
Penumbra.Log.Verbose($"Created new cache for collection {collection.AnonymizedName}.");
return true;
}
@ -295,7 +299,8 @@ public class CollectionCacheManager : IDisposable
collection._cache!.Dispose();
collection._cache = null;
--Count;
if (collection.Index > 0)
Interlocked.Decrement(ref _count);
Penumbra.Log.Verbose($"Cleared cache of collection {collection.AnonymizedName}.");
}