Skip to content

Commit

Permalink
Multiple fixes to figuring out inventory gift subid
Browse files Browse the repository at this point in the history
Figure out subid for guest passes too
Fix precise subid not working in inventory
Do not try to use non existing cache value
  • Loading branch information
xPaw committed Dec 26, 2024
1 parent 9c0bc61 commit 3b2050a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions scripts/community/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,12 +449,12 @@
foundState = FoundState.Added;
}
}
else if( hasPreciseSubIDsEnabled && item.description.owner_actions && item.description.type === 'Gift' )
else if( hasPreciseSubIDsEnabled && item.description.owner_actions && ( item.description.type === 'Gift' || item.description.type === 'Guest Pass' ) )
{
// If a gift has no actions, rgActions is undefined
if( !rgActions )
{
rgActions = [];
arguments[ 2 ] = item.description.actions = rgActions = [];
}

for( let i = 0; i < rgActions.length; i++ )
Expand All @@ -463,13 +463,20 @@

if( link.steamdb )
{
if( link.link.match( /^#steamdb_/ ) !== null )
foundState = FoundState.Added;

if( link.link.startsWith( '#steamdb_' ) )
{
rgActions[ i ].link = homepage + 'sub/' + giftCache[ item.description.classid ] + '/';
if( giftCache[ item.description.classid ] )
{
rgActions[ i ].link = homepage + 'sub/' + giftCache[ item.description.classid ] + '/';
}
else
{
foundState = FoundState.DisableButtons;
}
}

foundState = FoundState.Added;

break;
}
}
Expand Down

0 comments on commit 3b2050a

Please sign in to comment.