diff --git a/module/data/chat-message/actorRoll.mjs b/module/data/chat-message/actorRoll.mjs index 7071ed1e..11dca9e1 100644 --- a/module/data/chat-message/actorRoll.mjs +++ b/module/data/chat-message/actorRoll.mjs @@ -76,10 +76,14 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel { return fromUuidSync(this.source.actor); } - get actionItem() { + get item() { const actionActor = this.actionActor; if (!actionActor || !this.source.item) return null; + + return actionActor.items.get(this.source.item); + } + get actionItem() { switch (this.source.originItem.type) { case CONFIG.DH.ITEM.originItemType.restMove: const restMoves = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Homebrew).restMoves; @@ -87,11 +91,14 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel { this.source.originItem.actionIndex ]; default: - const item = actionActor.items.get(this.source.item); - return item ? item.system.actionsList?.find(a => a.id === this.source.action) : null; + return this.item?.system.actionsList?.find(a => a.id === this.source.action); } } + get hasReload() { + return this.item?.system.hasReload; + } + get action() { const { actionActor, actionItem: itemAction } = this; if (!this.source.action) return null; diff --git a/templates/ui/chat/parts/button-part.hbs b/templates/ui/chat/parts/button-part.hbs index b631192c..56c8625b 100644 --- a/templates/ui/chat/parts/button-part.hbs +++ b/templates/ui/chat/parts/button-part.hbs @@ -1,5 +1,5 @@