diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-01 00:22:29 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-01 00:22:29 -0500 |
commit | c5cfcc6c9ff36a7fc05916de95889c21dc6849ea (patch) | |
tree | 942396656d19bc1db438fe135462974f26945868 /src/SMAPI/Framework/StateTracking | |
parent | 844efa32d49baa2ca58332cd26bbbe3cc772ad22 (diff) | |
download | SMAPI-c5cfcc6c9ff36a7fc05916de95889c21dc6849ea.tar.gz SMAPI-c5cfcc6c9ff36a7fc05916de95889c21dc6849ea.tar.bz2 SMAPI-c5cfcc6c9ff36a7fc05916de95889c21dc6849ea.zip |
fix location snapshot not updated for removed chests
Diffstat (limited to 'src/SMAPI/Framework/StateTracking')
-rw-r--r-- | src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs b/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs index 4e08a1ac..edfba736 100644 --- a/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs +++ b/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs @@ -63,13 +63,12 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots this.TerrainFeatures.Update(watcher.TerrainFeaturesWatcher); // chest inventories - foreach (var pair in watcher.ChestWatchers) + this.ChestItems.Clear(); + foreach (ChestTracker tracker in watcher.ChestWatchers.Values) { - ItemStackChange[] changes = pair.Value.GetInventoryChanges().ToArray(); + ItemStackChange[] changes = tracker.GetInventoryChanges().ToArray(); if (changes.Length > 0) - this.ChestItems[pair.Value.Chest] = changes; - else - this.ChestItems.Remove(pair.Value.Chest); + this.ChestItems[tracker.Chest] = changes; } } } |