summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/ChestTracker.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/ChestTracker.cs')
-rw-r--r--src/SMAPI/Framework/StateTracking/ChestTracker.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/StateTracking/ChestTracker.cs b/src/SMAPI/Framework/StateTracking/ChestTracker.cs
index 4440bf4b..74039753 100644
--- a/src/SMAPI/Framework/StateTracking/ChestTracker.cs
+++ b/src/SMAPI/Framework/StateTracking/ChestTracker.cs
@@ -44,15 +44,15 @@ namespace StardewModdingAPI.Framework.StateTracking
public void Reset()
{
- this.PreviousInventory = this.CurrentInventory;
+ if(this.CurrentInventory!=null)
+ this.PreviousInventory = this.CurrentInventory;
}
public IEnumerable<ItemStackChange> GetInventoryChanges()
{
IDictionary<Item, int> previous = this.PreviousInventory;
- Console.WriteLine(previous.Count);
IDictionary<Item, int> current = this.GetInventory();
- Console.WriteLine(current.Count);
+
foreach (Item item in previous.Keys.Union(current.Keys))
{
if (!previous.TryGetValue(item, out int prevStack))