Handle "empty" CS2 inventories that aren't actually empty

This commit is contained in:
Alex Corn 2025-02-12 03:15:54 -05:00
parent 2f03e09f50
commit 67774f86f7
No known key found for this signature in database
GPG Key ID: 4E25AE41FE0072C7

View File

@ -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