Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Commit

Permalink
fix: prevent hook firing in cases where the workflow was aborted
Browse files Browse the repository at this point in the history
  • Loading branch information
akrigline committed Jan 7, 2022
1 parent 20c27fe commit 39a98a2
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/actor/rollAbilitySave.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function patchRollAbilitySave() {
async function rollAbilitySavePatch(wrapper, abilityId, options, ...rest) {
const result = await wrapper(abilityId, options, ...rest);

if (!result) return result;

const actor = this;

Hooks.callAll('Actor5e.rollAbilitySave', actor, result, abilityId, options);
Expand Down
2 changes: 2 additions & 0 deletions scripts/actor/rollAbilityTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ export function patchRollAbilityTest() {
async function rollAbilityTestPatch(wrapper, abilityId, options, ...rest) {
const result = await wrapper(abilityId, options, ...rest);

if (!result) return result;

const actor = this;

Hooks.callAll('Actor5e.rollAbilityTest', actor, result, abilityId, options);
Expand Down
2 changes: 2 additions & 0 deletions scripts/actor/rollDeathSave.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function patchRollDeathSave() {
async function rollDeathSavePatch(wrapper, options, ...rest) {
const result = await wrapper(options, ...rest);

if (!result) return result;

const actor = this;

Hooks.callAll('Actor5e.rollDeathSave', actor, result, options);
Expand Down
2 changes: 2 additions & 0 deletions scripts/actor/rollSkill.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function patchRollSkill() {
async function rollSkillPatch(wrapper, skillId, options, ...rest) {
const result = await wrapper(skillId, options, ...rest);

if (!result) return result;

const actor = this;

Hooks.callAll('Actor5e.rollSkill', actor, result, skillId, options);
Expand Down
2 changes: 2 additions & 0 deletions scripts/item/damageRoll.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function patchRollDamage() {
async function rollDamagePatch(wrapper, config, ...rest) {
const result = await wrapper(config, ...rest);

if (!result) return result;

const item = this;
const actor = this.actor;

Expand Down
2 changes: 2 additions & 0 deletions scripts/item/roll.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function patchRoll() {
async function rollPatch(wrapper, options, ...rest) {
const chatMessage = await wrapper(options, ...rest);

if (!chatMessage) return chatMessage;

const item = this;
const actor = this.actor;

Expand Down
2 changes: 2 additions & 0 deletions scripts/item/rollFormula.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export function patchRollFormula() {
async function rollFormulaPatch(wrapper, config, ...rest) {
const result = await wrapper(config, ...rest);

if (!result) return result;

const item = this;
const actor = this.actor;

Expand Down
2 changes: 2 additions & 0 deletions scripts/item/rollRecharge.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export function patchRollRecharge() {
async function rollRechargePatch(wrapped, ...args) {
const result = await wrapped(...args);

if (!result) return result;

const item = this;
const actor = this.actor;

Expand Down
2 changes: 2 additions & 0 deletions scripts/item/rollToolCheck.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export function patchRollToolCheck() {
async function rollToolCheckPatch(wrapper, options, ...rest) {
const result = await wrapper(options, ...rest);

if (!result) return result;

const item = this;
const actor = this.actor;

Expand Down

0 comments on commit 39a98a2

Please sign in to comment.