diff --git a/changelog.md b/changelog.md index b769dc90..b48e8119 100644 --- a/changelog.md +++ b/changelog.md @@ -4,6 +4,7 @@ - Updated German localization (Thank you, gsterling on GitHub) - Added Starfinder system support (Thank you, dizko on GitHub) - Updated Tormenta20 system configuration (Thank you, mclemente on GitHub) +- Fixed hidden item piles being able to be opened ## Version 1.4.7 - Fixed issue in latest PF2 update which changed the attribute path for quantities diff --git a/scripts/hotkeys.js b/scripts/hotkeys.js index eaffc5df..50d4bf11 100644 --- a/scripts/hotkeys.js +++ b/scripts/hotkeys.js @@ -77,7 +77,12 @@ export function registerHotkeysPost() { if (event.button !== 0) return; const pos = canvas.app.renderer.plugins.interaction.mouse.getLocalPosition(canvas.app.stage); - const tokens = lib.getTokensAtLocation(pos).filter(token => !token._canView(game.user)); + const tokens = lib.getTokensAtLocation(pos) + .filter(token => { + const canView = token._canView(game.user); + const canSee = !token.data.hidden || game.user.isGM; + return !canView && canSee; + }); if (!tokens.length) return; tokens.sort((a, b) => b.zIndex - a.zIndex); const token = tokens[0].document;