Skip to content

Commit

Permalink
But keep trading only of cards + foils
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Apr 20, 2016
1 parent 1df9af0 commit 770a8fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ArchiSteamFarm/JSON/Steam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,16 @@ internal ulong OtherSteamID64 {
}
}

internal bool IsSteamOnlyTrade {
internal bool IsSteamCardsOnlyTrade {
get {
foreach (Item item in ItemsToGive) {
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID) {
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID || (item.Type != Item.EType.FoilTradingCard && item.Type != Item.EType.TradingCard)) {
return false;
}
}

foreach (Item item in ItemsToReceive) {
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID) {
if (item.AppID != Item.SteamAppID || item.ContextID != Item.SteamContextID || (item.Type != Item.EType.FoilTradingCard && item.Type != Item.EType.TradingCard)) {
return false;
}
}
Expand Down
6 changes: 3 additions & 3 deletions ArchiSteamFarm/Trading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@ private bool ShouldAcceptTrade(Steam.TradeOffer tradeOffer) {
return false;
}

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

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

0 comments on commit 770a8fe

Please sign in to comment.