Skip to content

Commit

Permalink
fix stats reading in case there are multiple with same lostat identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Zutatensuppe committed Jun 16, 2021
1 parent 08f96aa commit 4757969
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/D2Reader/Readers/UnitReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,11 @@ public List<D2Stat> GetStats(D2Unit unit)

public Dictionary<StatIdentifier, D2Stat> 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)
Expand Down
4 changes: 2 additions & 2 deletions src/DiabloInterface/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit 4757969

Please sign in to comment.