Skip to content

Commit 770a8fe

Browse files
committed
But keep trading only of cards + foils
1 parent 1df9af0 commit 770a8fe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

ArchiSteamFarm/JSON/Steam.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,16 +249,16 @@ internal ulong OtherSteamID64 {
249249
}
250250
}
251251

252-
internal bool IsSteamOnlyTrade {
252+
internal bool IsSteamCardsOnlyTrade {
253253
get {
254254
foreach (Item item in ItemsToGive) {
255-
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID) {
255+
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID || (item.Type != Item.EType.FoilTradingCard && item.Type != Item.EType.TradingCard)) {
256256
return false;
257257
}
258258
}
259259

260260
foreach (Item item in ItemsToReceive) {
261-
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID) {
261+
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID || (item.Type != Item.EType.FoilTradingCard && item.Type != Item.EType.TradingCard)) {
262262
return false;
263263
}
264264
}

ArchiSteamFarm/Trading.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,13 @@ private bool ShouldAcceptTrade(Steam.TradeOffer tradeOffer) {
153153
return false;
154154
}
155155

156-
// Rule 2 - We always trade steam itmes and only for the same set
157-
if (!tradeOffer.IsSteamOnlyTrade || !tradeOffer.IsPotentiallyDupesTrade) {
156+
// Rule 2 - We always trade steam cards and only for the same set
157+
if (!tradeOffer.IsSteamCardsOnlyTrade || !tradeOffer.IsPotentiallyDupesTrade) {
158158
return false;
159159
}
160160

161161
// This STM trade SHOULD be fine
162-
// Potential TODO: Ensure that our inventory in fact has proper amount of both received and given items
162+
// Potential TODO: Ensure that our inventory in fact has proper amount of both received and given cards
163163
// This way we could calculate amounts before and after trade, ensuring that we're in fact trading dupes and not 1 + 2 -> 0 + 3
164164
return true;
165165
}

0 commit comments

Comments
 (0)