Fix monster attacks per round

master
John Downey 2022-04-09 22:23:40 -05:00
parent c9d111023b
commit 14c9252f07
2 changed files with 5 additions and 7 deletions

View File

@ -136,13 +136,11 @@ export class AcksActorSheetMonster extends AcksActorSheet {
}
async _resetCounters(event) {
const weapons = this.actor.data.items.filter(i => i.type === 'weapon');
for (let wp of weapons) {
const item = this.actor.items.get(wp._id);
await item.update({
for (const weapon of this.actor.itemTypes["weapon"]) {
await weapon.update({
data: {
counter: {
value: parseInt(wp.data.counter.max),
value: parseInt(weapon.data.data.counter.max, 10),
},
},
});

View File

@ -129,10 +129,10 @@
</div>
{{#if (eq item.type 'weapon')}}
<div class="field-long counter flexrow">
<input type="text" value="{{item.data.data.counter.value}}" data-dtype="Number"
<input type="text" value="{{item.data.counter.value}}" data-dtype="Number"
placeholder="0" data-field="value" title="{{localize 'ACKS.items.roundAttacks'}}">
/
<input type="text" value="{{item.data.data.counter.max}}" data-field="max"
<input type="text" value="{{item.data.counter.max}}" data-field="max"
data-dtype="Number" placeholder="0"
title="{{localize 'ACKS.items.roundAttacksMax'}}"></div>
{{/if}}