mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-04-02 05:40:12 +08:00
Make CMarketItem not broken for non-CSGO apps (fixes #196)
This commit is contained in:
parent
645e03b89c
commit
754847ee88
@ -49,7 +49,7 @@ function CMarketItem(appid, hashName, community, body, $) {
|
||||
}
|
||||
|
||||
this.commodity = false;
|
||||
var match = body.match(/Market_LoadOrderSpread\(\s*(\d+)\s*\);/);
|
||||
match = body.match(/Market_LoadOrderSpread\(\s*(\d+)\s*\);/);
|
||||
if(match) {
|
||||
this.commodity = true;
|
||||
this.commodityID = parseInt(match[1], 10);
|
||||
@ -78,7 +78,8 @@ function CMarketItem(appid, hashName, community, body, $) {
|
||||
if (match) {
|
||||
try {
|
||||
this.assets = JSON.parse(match[1]);
|
||||
this.assets = this.assets['730']['2'];
|
||||
this.assets = this.assets[appid];
|
||||
this.assets = this.assets[Object.keys(this.assets)[0]];
|
||||
this.firstAsset = this.assets[Object.keys(this.assets)[0]];
|
||||
} catch (e) {
|
||||
// ignore
|
||||
|
Loading…
Reference in New Issue
Block a user