From 35e6dd16e72509f9f0500b7a3f528a375d62ef35 Mon Sep 17 00:00:00 2001 From: Alexander Corn Date: Tue, 13 Dec 2016 01:07:00 -0500 Subject: [PATCH] Re-add "pos" property to inventory items for backwards compatibility --- components/users.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/users.js b/components/users.js index d70815b..491fbf4 100644 --- a/components/users.js +++ b/components/users.js @@ -263,7 +263,8 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t if(typeof userID === 'string') { userID = new SteamID(userID); } - + + var pos = 1; get([], [], 1); function get(inventory, currency, step, start) { @@ -305,6 +306,7 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t var description = getDescription(body.descriptions, body.assets[i].classid, body.assets[i].instanceid); if (!tradableOnly || (description && description.tradable)) { + body.assets[i].pos = pos++; (body.assets[i].currencyid ? currency : inventory).push(new CEconItem(body.assets[i], description, contextID)); } }