summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/Utilities
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-02 19:13:27 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-02 19:13:27 -0400
commit546b58778c9e1e983f1682f1b89cbc353939d9ea (patch)
tree7bc289cf525e01ff7a59056734623237b9598723 /src/SMAPI/Framework/Utilities
parentf58cdde981f7dfabb5783c80b29f4996d76cec30 (diff)
downloadSMAPI-546b58778c9e1e983f1682f1b89cbc353939d9ea.tar.gz
SMAPI-546b58778c9e1e983f1682f1b89cbc353939d9ea.tar.bz2
SMAPI-546b58778c9e1e983f1682f1b89cbc353939d9ea.zip
switch to 'processing tick' for tick caching
This is incremented on each low-level tick (whether it's a game update, synchronized async operation, etc). That mainly avoids the cache persisting across the entire save loading process while it's being synchronized.
Diffstat (limited to 'src/SMAPI/Framework/Utilities')
-rw-r--r--src/SMAPI/Framework/Utilities/TickCacheDictionary.cs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs b/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs
index 5921e089..d0f276d2 100644
--- a/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs
+++ b/src/SMAPI/Framework/Utilities/TickCacheDictionary.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using StardewValley;
namespace StardewModdingAPI.Framework.Utilities
{
@@ -28,10 +27,10 @@ namespace StardewModdingAPI.Framework.Utilities
public TValue GetOrSet(TKey cacheKey, Func<TValue> get)
{
// clear cache on new tick
- if (SCore.TicksElapsed != this.LastGameTick)
+ if (SCore.ProcessTicksElapsed != this.LastGameTick)
{
this.Cache.Clear();
- this.LastGameTick = SCore.TicksElapsed;
+ this.LastGameTick = SCore.ProcessTicksElapsed;
}
// fetch value