Skip to content

Commit

Permalink
11.17 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ironmonk88 committed Mar 31, 2024
1 parent 4248a3f commit 064c9ed
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Version 11.17

Fixing a silly mistake that made redirecting rolls no longer work

Added the option to use handlebars when redirecting rolls

## Version 11.16

Fixed issue when trying to call a requested roll or contested roll when there's no event triggering it.
Expand Down
2 changes: 1 addition & 1 deletion apps/contestedroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ export class ContestedRoll {
if (restart.action.data.usetokens == 'fail' || restart.action.data.usetokens == 'succeed') {
result.tokens = result.tokenresults.filter(r => r.passed == (restart.action.data.usetokens == 'succeed'));
} else {
result.tokens = result.tokenresults;
result.tokens = duplicate(result.tokenresults);
}
for (let i = 0; i < result.tokens.length; i++) {
result.tokens[i] = await fromUuid(result.tokens[i].uuid);
Expand Down
2 changes: 1 addition & 1 deletion apps/savingthrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ export class SavingThrow {
if (restart.action.data.usetokens == 'fail' || restart.action.data.usetokens == 'succeed') {
result.tokens = result.tokenresults.filter(r => r.passed == (restart.action.data.usetokens == 'succeed'));
} else {
result.tokens = result.tokenresults;
result.tokens = duplicate(result.tokenresults);
}
for (let i = 0; i < result.tokens.length; i++) {
result.tokens[i] = await fromUuid(result.tokens[i].uuid);
Expand Down
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Monk's TokenBar",
"description": "Add a bar with all the current player tokens. Limit movement, roll saving throws, assign XP.",
"version": "11.16",
"version": "11.17",
"authors": [
{
"name": "IronMonk",
Expand Down Expand Up @@ -82,7 +82,7 @@
"css/tokenbar.css"
],
"url": "https://github.com/ironmonk88/monks-tokenbar",
"download": "https://github.com/ironmonk88/monks-tokenbar/archive/11.16.zip",
"download": "https://github.com/ironmonk88/monks-tokenbar/archive/11.17.zip",
"manifest": "https://github.com/ironmonk88/monks-tokenbar/releases/latest/download/module.json",
"bugs": "https://github.com/ironmonk88/monks-tokenbar/issues",
"allowBugReporter": true,
Expand Down
8 changes: 5 additions & 3 deletions monks-tokenbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1737,13 +1737,15 @@ Hooks.on("setupTileActions", (app) => {

let goto = [];
if (action.data.failed) {
let data = { tokens: await Promise.all((value.tokenresults || []).filter(r => !r.passed).map(async (t) => { return await fromUuid(t.uuid); })), tag: action.data.failed };
var failed = await game.MonksActiveTiles.getValue(action.data.failed, args, null, { prop: "" });
let data = { tokens: await Promise.all((value.tokenresults || []).filter(r => !r.passed).map(async (t) => { return await fromUuid(t.uuid); })), tag: failed };
if (data.tokens.length)
goto.push(data);
}

if (action.data.passed) {
let data = { tokens: await Promise.all((value.tokenresults || []).filter(r => r.passed).map(async (t) => { return await fromUuid(t.uuid); })), tag: action.data.passed };
var passed = await game.MonksActiveTiles.getValue(action.data.passed, args, null, { prop: "" });
let data = { tokens: await Promise.all((value.tokenresults || []).filter(r => r.passed).map(async (t) => { return await fromUuid(t.uuid); })), tag: passed };
if (data.tokens.length)
goto.push(data);
}
Expand Down Expand Up @@ -1810,7 +1812,7 @@ Hooks.on("setupTileActions", (app) => {

entities = entities.map(e => e.object);

let xp = game.MonksActiveTiles.getValue(action.data.xp, args);
let xp = await game.MonksActiveTiles.getValue(action.data.xp, args);

let assignxp = new AssignXPApp(entities, { xp: xp, reason: action.data.reason, dividexp: action.data.dividexp});
if (action.data.silent === true) {
Expand Down

0 comments on commit 064c9ed

Please sign in to comment.