Fix monster attacks per round
							parent
							
								
									c9d111023b
								
							
						
					
					
						commit
						14c9252f07
					
				|  | @ -136,13 +136,11 @@ export class AcksActorSheetMonster extends AcksActorSheet { | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   async _resetCounters(event) { |   async _resetCounters(event) { | ||||||
|     const weapons = this.actor.data.items.filter(i => i.type === 'weapon'); |     for (const weapon of this.actor.itemTypes["weapon"]) { | ||||||
|     for (let wp of weapons) { |       await weapon.update({ | ||||||
|       const item = this.actor.items.get(wp._id); |  | ||||||
|       await item.update({ |  | ||||||
|         data: { |         data: { | ||||||
|           counter: { |           counter: { | ||||||
|             value: parseInt(wp.data.counter.max), |             value: parseInt(weapon.data.data.counter.max, 10), | ||||||
|           }, |           }, | ||||||
|         }, |         }, | ||||||
|       }); |       }); | ||||||
|  |  | ||||||
|  | @ -129,10 +129,10 @@ | ||||||
|                             </div> |                             </div> | ||||||
|                             {{#if (eq item.type 'weapon')}} |                             {{#if (eq item.type 'weapon')}} | ||||||
|                             <div class="field-long counter flexrow"> |                             <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'}}"> |                                     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" |                                     data-dtype="Number" placeholder="0" | ||||||
|                                     title="{{localize 'ACKS.items.roundAttacksMax'}}"></div> |                                     title="{{localize 'ACKS.items.roundAttacksMax'}}"></div> | ||||||
|                             {{/if}} |                             {{/if}} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue