Skip to content

Commit

Permalink
🔀 Merge pull request #1206 from TF2Autobot/error-15
Browse files Browse the repository at this point in the history
🔄 properly handle error 15 (not only full backpack)
  • Loading branch information
idinium96 authored Jul 12, 2022
2 parents 2793714 + 57d635c commit 2560dc2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/classes/Carts/Cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,17 @@ export default abstract class Cart {
const ourNumItems = this.ourItemsCount;
const theirNumItems = this.theirItemsCount;

if (
theirTotalSlots === 0 ||
!(
(ourUsedSlots + theirNumItems) / ourTotalSlots >= 1 ||
(theirUsedSlots + ourNumItems) / theirTotalSlots >= 1
)
) {
// Error 15 but failed to get their total slot, or not because inventory was full
return Promise.reject(`An error with code 15 (https://steamerrors.com/15) has occured`);
}

const dwEnabled =
opt.discordWebhook.sendAlert.enable && opt.discordWebhook.sendAlert.url.main !== '';

Expand Down

0 comments on commit 2560dc2

Please sign in to comment.