This commit is contained in:
Łukasz Domeradzki 2024-09-19 14:08:45 +02:00
parent 1dff9a48a8
commit 440e43935a
No known key found for this signature in database
GPG key ID: 6B138B4C64555AEA

View file

@ -550,6 +550,9 @@ public sealed class Trading : IDisposable {
bool accept = IsTradeNeutralOrBetter(inventory, tradeOffer.ItemsToGive, tradeOffer.ItemsToReceive); bool accept = IsTradeNeutralOrBetter(inventory, tradeOffer.ItemsToGive, tradeOffer.ItemsToReceive);
// We're now sure whether the trade is neutral+ for us or not
ParseTradeResult.EResult acceptResult;
if (accept) { if (accept) {
// Ensure that accepting this trade offer does not create conflicts with other // Ensure that accepting this trade offer does not create conflicts with other
lock (handledSets) { lock (handledSets) {
@ -561,10 +564,11 @@ public sealed class Trading : IDisposable {
handledSets.UnionWith(wantedSets); handledSets.UnionWith(wantedSets);
} }
}
// We're now sure whether the trade is neutral+ for us or not acceptResult = ParseTradeResult.EResult.Accepted;
ParseTradeResult.EResult acceptResult = accept ? ParseTradeResult.EResult.Accepted : ParseTradeResult.EResult.Rejected; } else {
acceptResult = ParseTradeResult.EResult.Rejected;
}
Bot.ArchiLogger.LogGenericDebug(Strings.FormatBotTradeOfferResult(tradeOffer.TradeOfferID, acceptResult, nameof(IsTradeNeutralOrBetter))); Bot.ArchiLogger.LogGenericDebug(Strings.FormatBotTradeOfferResult(tradeOffer.TradeOfferID, acceptResult, nameof(IsTradeNeutralOrBetter)));