From 67774f86f767fe21dea03f502bd94fea821b0bc2 Mon Sep 17 00:00:00 2001 From: Alex Corn Date: Wed, 12 Feb 2025 03:15:54 -0500 Subject: [PATCH] Handle "empty" CS2 inventories that aren't actually empty --- components/users.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/users.js b/components/users.js index 80e4bec..c468452 100644 --- a/components/users.js +++ b/components/users.js @@ -629,6 +629,13 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont return; } + if (appID == 730 && body && body.success && !body.assets) { + // CS inventory has no visible items. We need a special case for this because Valve is incapable of + // doing anything not dumb. + callback(null, [], [], body.total_inventory_count); + return; + } + if (!body || !body.success || !body.assets || !body.descriptions) { if (body) { // Dunno if the error/Error property even exists on this new endpoint