Skip to content

Commit 11d3bdf

Browse files
committed
More trade protected item fixes
1 parent 9b61a4c commit 11d3bdf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/cs2/items/inventory.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ export default class Inventory {
3939

4040
// Cache icons for items already in our inventory
4141
if (!Icons.URLs[item.full_name]) {
42-
const asset = unsafeWindow.g_rgAppContextData[CS2_APPID].rgContexts[2].inventory.m_rgAssets[item.iteminfo.id];
42+
for (const contextId in unsafeWindow.g_rgAppContextData[CS2_APPID].rgContexts) {
43+
const asset = unsafeWindow.g_rgAppContextData[CS2_APPID].rgContexts[contextId].inventory.m_rgAssets[item.iteminfo.id];
4344

44-
if (asset) {
45-
Icons.SetIcon(item.full_name, asset.description.icon_url);
45+
if (asset) {
46+
Icons.SetIcon(item.full_name, asset.description.icon_url);
47+
break;
48+
}
4649
}
4750
}
4851
}

0 commit comments

Comments
 (0)