From 6da300519a3738789c171d8c7f8eecd510ae708b Mon Sep 17 00:00:00 2001 From: U~man Date: Sun, 26 Jul 2020 00:03:40 +0200 Subject: [PATCH] FIX: Speedrolling --- src/module/actor/actor-sheet.js | 2 +- src/module/dice.js | 4 ++-- src/module/item/entity.js | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/module/actor/actor-sheet.js b/src/module/actor/actor-sheet.js index 0cdd053..058b983 100644 --- a/src/module/actor/actor-sheet.js +++ b/src/module/actor/actor-sheet.js @@ -147,7 +147,7 @@ export class OseActorSheet extends ActorSheet { data: { counter: { value: item.data.data.counter.value - 1 } }, }); } - item.rollWeapon({ skipDialog: ev.ctrlKey }); + item.rollWeapon({ skipDialog: ev.ctrlKey }); } else if (item.type == "spell") { item.spendSpell({ skipDialog: ev.ctrlKey }); } else { diff --git a/src/module/dice.js b/src/module/dice.js index 8093d27..6692fdf 100644 --- a/src/module/dice.js +++ b/src/module/dice.js @@ -259,7 +259,7 @@ export class OseDice { speaker: speaker, }; if (skipDialog) { - return data.roll.type === "attack" + return ["melee", "missile", "attack"].includes(data.roll.type) ? OseDice.sendAttackRoll(rollData) : OseDice.sendRoll(rollData); } @@ -271,7 +271,7 @@ export class OseDice { callback: (html) => { rolled = true; rollData.form = html[0].children[0]; - roll = ["melee", "missile"].includes(data.roll.type) + roll = ["melee", "missile", "attack"].includes(data.roll.type) ? OseDice.sendAttackRoll(rollData) : OseDice.sendRoll(rollData); }, diff --git a/src/module/item/entity.js b/src/module/item/entity.js index 27365b2..8995acf 100644 --- a/src/module/item/entity.js +++ b/src/module/item/entity.js @@ -67,7 +67,7 @@ export class OseItem extends Item { rollWeapon(options = {}) { let isNPC = this.actor.data.type != "character"; const data = this.data.data; - let type = "melee"; + let type = isNPC ? "attack" : "melee"; if (data.missile && data.melee && !isNPC) { // Dialog new Dialog({ @@ -86,7 +86,7 @@ export class OseItem extends Item { save: this.data.data.save, }, }, - { type: "melee" } + { type: "melee", skipDialog: options.skipDialog } ); }, }, @@ -102,7 +102,7 @@ export class OseItem extends Item { actor: this.actor.data, item: this.data, }, - { type: "missile" } + { type: "missile", skipDialog: options.skipDialog } ); }, }, @@ -121,7 +121,7 @@ export class OseItem extends Item { save: this.data.data.save, }, }, - { type: type } + { type: type, skipDialog: options.skipDialog } ); return true;