summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-04-11 15:41:32 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-04-11 15:41:32 -0400
commitfa335f80beee17f17ecedcfa7bcb6f9967a39776 (patch)
treeeb09d24d7fa28ba6adc844d5cb5cc456f74e5397 /src/SMAPI
parent83969b57890ea1633ddc14ec58282d0c61c36637 (diff)
downloadSMAPI-fa335f80beee17f17ecedcfa7bcb6f9967a39776.tar.gz
SMAPI-fa335f80beee17f17ecedcfa7bcb6f9967a39776.tar.bz2
SMAPI-fa335f80beee17f17ecedcfa7bcb6f9967a39776.zip
fix crash when player has duplicate item references
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/SGame.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/SGame.cs b/src/SMAPI/Framework/SGame.cs
index ae702711..9af02dd4 100644
--- a/src/SMAPI/Framework/SGame.cs
+++ b/src/SMAPI/Framework/SGame.cs
@@ -569,7 +569,7 @@ namespace StardewModdingAPI.Framework
this.PreviousForagingLevel = Game1.player.foragingLevel;
this.PreviousMiningLevel = Game1.player.miningLevel;
this.PreviousLuckLevel = Game1.player.luckLevel;
- this.PreviousItems = Game1.player.items.Where(n => n != null).ToDictionary(n => n, n => n.Stack);
+ this.PreviousItems = Game1.player.items.Where(n => n != null).Distinct().ToDictionary(n => n, n => n.Stack);
this.PreviousLocationObjects = this.GetHash(Game1.currentLocation.objects);
this.PreviousTime = Game1.timeOfDay;
this.PreviousMineLevel = Game1.mine?.mineLevel ?? 0;