From ceff02df226281550aa1fb80e4f3aabde750197f Mon Sep 17 00:00:00 2001 From: JustArchi Date: Fri, 18 Jan 2019 03:31:36 +0100 Subject: [PATCH] Avoid matching the same set with the same user as well In several cases ASF sent more than 1 trade considering the same items, this happens when we have more possible matches than just one but for the same card of other side. Since we do not preserve the state (due to various reasons), the proper thing to do is to make set exclusive not only to user, but also to a single trade offer. At worst we'll just finish remaining part of it in the next round, if by any chance our trade offer is so huge it stumbles upon 255 items limit. --- ArchiSteamFarm/Statistics.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArchiSteamFarm/Statistics.cs b/ArchiSteamFarm/Statistics.cs index 877a735ed..da1d54798 100644 --- a/ArchiSteamFarm/Statistics.cs +++ b/ArchiSteamFarm/Statistics.cs @@ -343,7 +343,7 @@ namespace ArchiSteamFarm { Dictionary classIDsToGive = new Dictionary(); Dictionary classIDsToReceive = new Dictionary(); - foreach (((uint AppID, Steam.Asset.EType Type) set, Dictionary ourFullItems) in fullState.Where(set => listedUser.MatchableTypes.Contains(set.Key.Type) && set.Value.Values.Any(count => count > 1))) { + foreach (((uint AppID, Steam.Asset.EType Type) set, Dictionary ourFullItems) in fullState.Where(set => !skippedSetsThisUser.Contains(set.Key) && listedUser.MatchableTypes.Contains(set.Key.Type) && set.Value.Values.Any(count => count > 1))) { if (!tradableState.TryGetValue(set, out Dictionary ourTradableItems) || (ourTradableItems.Count == 0)) { continue; }