Skip to content

Commit

Permalink
Fixed global tension die error in case of no active scene
Browse files Browse the repository at this point in the history
  • Loading branch information
sadovsf committed Sep 20, 2021
1 parent cf9056e commit b67c984
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions sgrpg.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,5 @@ Hooks.on("renderChatPopout", (app, html, data) => ItemSg.chatListeners(html));
*/
function getTensionDie() {
// First, try to get the Tension Die of the currently active scene, if that turns out unset, get the Tension Die of the campaign
const tensionDie = game.scenes.active.getFlag("sgrpg", "sceneTensionDie") || game.settings.get("sgrpg", "campaignTension");
return tensionDie;
return game.scenes.active?.getFlag("sgrpg", "sceneTensionDie") || game.settings.get("sgrpg", "campaignTension");
}

0 comments on commit b67c984

Please sign in to comment.