Fixed various action calling issues

This commit is contained in:
ThaumRystra
2025-07-25 19:15:40 +02:00
parent 41e9fb4069
commit 899dcf42b1
12 changed files with 27 additions and 17 deletions

View File

@@ -229,6 +229,7 @@ export default {
creatureId: this.model.root.id,
$store: this.$store,
elementId: `${this.model._id}-do-action-button`,
targetIds: [],
}).catch((e) => {
console.error(e);
}).finally(() => {

View File

@@ -50,6 +50,7 @@ export default {
creatureId: this.model.root.id,
$store: this.$store,
elementId: `event-btn-${this.model._id}`,
targetIds: [],
}).catch(error => {
snackbar({ text: error.reason || error.message || error.toString() });
console.error(error);

View File

@@ -98,7 +98,6 @@ export default {
elementId: `check-btn-${this.model._id}`,
task: {
subtaskFn: 'check',
prop: this.model,
targetIds: [this.model.root.id],
advantage: this.model.advantage,
skillVariableName: undefined,

View File

@@ -83,7 +83,6 @@ export default {
elementId: `check-btn-${this.model._id}`,
task: {
subtaskFn: 'check',
prop: this.model,
targetIds: [this.model.root.id],
advantage: this.model.advantage,
skillVariableName: this.model.variableName,

View File

@@ -121,7 +121,6 @@ export default {
elementId: `spell-slot-list-tile-${model._id}`,
task: {
subtaskFn: 'damageProp',
prop: model,
targetIds: [model.root.id],
params: {
title: getPropertyTitle(model),

View File

@@ -101,7 +101,6 @@ export default {
elementId: this.dataId,
task: {
subtaskFn: 'damageProp',
prop: model,
targetIds: [model.root.id],
params: {
title: getPropertyTitle(model),

View File

@@ -110,7 +110,6 @@ export default {
elementId: `check-btn-${this.model._id}`,
task: {
subtaskFn: 'check',
prop: this.model,
targetIds: [this.model.root.id],
advantage: this.model.advantage,
skillVariableName: this.model.variableName,

View File

@@ -360,12 +360,17 @@ export default {
const withoutSpellSlot = slotId === 'no-slot';
if (ritual || withoutSpellSlot) slotId = undefined;
const $store = this.$store;
const spell = CreatureProperties.findOne(spellId);
if (!spell || spell.type !== 'spell') {
return;
}
doAction({
creatureId: this.creatureId,
$store,
task: {
subtaskFn: 'castSpell',
prop: CreatureProperties.findOne(spellId),
prop: spell,
targetIds: [],
params: {
slotId,
ritual,