Skip to content

Commit

Permalink
#24
Browse files Browse the repository at this point in the history
- #24: Fix actions not working for the assigned character when a token
  has never been added to the scene.
  • Loading branch information
Larkinabout committed Feb 22, 2023
1 parent 09cd847 commit b38df43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/roll-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class RollHandler extends CoreRollHandler {
const tokenId = payload[2]
const actionId = payload[3]

if (tokenId === 'multi' && actionId !== 'toggleCombat') {
if (actorId === 'multi' && tokenId === 'multi' && actionId !== 'toggleCombat') {
for (const token of canvas.tokens.controlled) {
const tokenActorId = token.actor?.id
const tokenTokenId = token.id
Expand Down Expand Up @@ -268,6 +268,7 @@ export class RollHandler extends CoreRollHandler {
*/
async _toggleCondition (event, tokenId, actionId, effect = null) {
const token = CoreUtils.getToken(tokenId)
if (!token) return
const isRightClick = this.isRightClick(event)
if (game.dfreds && effect?.flags?.isConvenient) {
const effectLabel = effect.label
Expand Down

0 comments on commit b38df43

Please sign in to comment.