diff --git a/Content.Shared/Chemistry/Reagent/ReagentId.cs b/Content.Shared/Chemistry/Reagent/ReagentId.cs index 798dd28db4..88c0abff2a 100644 --- a/Content.Shared/Chemistry/Reagent/ReagentId.cs +++ b/Content.Shared/Chemistry/Reagent/ReagentId.cs @@ -75,7 +75,21 @@ public partial struct ReagentId : IEquatable public override int GetHashCode() { - return HashCode.Combine(Prototype, Data); + // We need to make sure we take the hash code of Data by value in order + // for hashed key lookups to work properly + var hash = 17; + unchecked + { + if (Data?.Count != 0) + { + foreach (var data in Data ?? []) + { + hash = hash * 23 + data.GetHashCode(); + } + } + } + + return HashCode.Combine(Prototype, hash); } public string ToString(FixedPoint2 quantity)