diff --git a/classes/CEconItem.js b/classes/CEconItem.js index 9b2165f..3df1729 100644 --- a/classes/CEconItem.js +++ b/classes/CEconItem.js @@ -1,6 +1,6 @@ module.exports = CEconItem; -function CEconItem(item, descriptions) { +function CEconItem(item, descriptions, contextID) { var thing; for(thing in item) { if(item.hasOwnProperty(thing)) { @@ -11,6 +11,7 @@ function CEconItem(item, descriptions) { this.assetid = this.id = (this.id || this.assetid); this.instanceid = this.instanceid || '0'; this.amount = parseInt(this.amount, 10); + this.contextid = contextID.toString(); // Merge the description var description = descriptions[this.classid + '_' + this.instanceid]; diff --git a/components/users.js b/components/users.js index 42c57dd..c749f50 100644 --- a/components/users.js +++ b/components/users.js @@ -272,7 +272,7 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t continue; } - inventory.push(new CEconItem(body.rgInventory[i], body.rgDescriptions)); + inventory.push(new CEconItem(body.rgInventory[i], body.rgDescriptions, contextID)); } for(i in body.rgCurrency) { @@ -280,7 +280,7 @@ SteamCommunity.prototype.getUserInventory = function(userID, appID, contextID, t continue; } - currency.push(new CEconItem(body.rgInventory[i], body.rgDescriptions)); + currency.push(new CEconItem(body.rgInventory[i], body.rgDescriptions, contextID)); } if(body.more) {