fix location snapshot not updated for removed chests
This commit is contained in:
parent
844efa32d4
commit
c5cfcc6c9f
|
@ -63,13 +63,12 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots
|
||||||
this.TerrainFeatures.Update(watcher.TerrainFeaturesWatcher);
|
this.TerrainFeatures.Update(watcher.TerrainFeaturesWatcher);
|
||||||
|
|
||||||
// chest inventories
|
// 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)
|
if (changes.Length > 0)
|
||||||
this.ChestItems[pair.Value.Chest] = changes;
|
this.ChestItems[tracker.Chest] = changes;
|
||||||
else
|
|
||||||
this.ChestItems.Remove(pair.Value.Chest);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue