From ab1eece993af7b910e457b67aba660456e0821a6 Mon Sep 17 00:00:00 2001 From: Zutatensuppe Date: Wed, 16 Jun 2021 09:07:14 +0200 Subject: [PATCH] fix stats reading in case there are multiple with same lostat identifier --- src/D2Reader/Readers/UnitReader.cs | 9 +++++---- src/DiabloInterface/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/D2Reader/Readers/UnitReader.cs b/src/D2Reader/Readers/UnitReader.cs index 8634b76..c730219 100644 --- a/src/D2Reader/Readers/UnitReader.cs +++ b/src/D2Reader/Readers/UnitReader.cs @@ -85,10 +85,11 @@ public List GetStats(D2Unit unit) public Dictionary GetStatsMap(D2Unit unit) { - return (from stat in GetStats(unit) - where stat.HasValidLoStatIdentifier() - group stat by (StatIdentifier)stat.LoStatID into g - select g).ToDictionary(x => x.Key, x => x.Single()); + var tmp = (from stat in GetStats(unit) + where stat.HasValidLoStatIdentifier() + group stat by (StatIdentifier)stat.LoStatID into g + select g); + return tmp.ToDictionary(x => x.Key, x => x.First()); } public int? GetStatValue(D2Unit unit, ushort statId) diff --git a/src/DiabloInterface/Properties/AssemblyInfo.cs b/src/DiabloInterface/Properties/AssemblyInfo.cs index b061ca3..c62dbdb 100644 --- a/src/DiabloInterface/Properties/AssemblyInfo.cs +++ b/src/DiabloInterface/Properties/AssemblyInfo.cs @@ -21,5 +21,5 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("25bb3310-9bd7-4234-af7d-9f7fb6870a20")] -[assembly: AssemblyVersion("21.6.12")] -[assembly: AssemblyInformationalVersion("21.6.12")] +[assembly: AssemblyVersion("21.6.16")] +[assembly: AssemblyInformationalVersion("21.6.16")]