Fixed so that only attack actions use the reload functionality on an item

This commit is contained in:
WBHarry 2026-07-01 13:06:55 +02:00
parent 3817469e35
commit 6d3337ab61
2 changed files with 18 additions and 11 deletions

View file

@ -125,7 +125,10 @@ export default class DHRoll extends Roll {
const reloadSetting =
game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation).reload;
const useReload = item?.system.hasReload && reloadSetting === CONFIG.DH.SETTINGS.reloadChoices.auto.id;
const useReload =
item?.system.hasReload &&
action?.type === 'attack' &&
reloadSetting === CONFIG.DH.SETTINGS.reloadChoices.auto.id;
const needReload = useReload ? await action?.handleReload?.() : false;
const cls = getDocumentClass('ChatMessage'),
@ -162,6 +165,7 @@ export default class DHRoll extends Roll {
return foundry.applications.handlebars.renderTemplate(template, {
roll: this,
...chatData,
action: chatData.action,
parent: chatData.parent,
targetMode: chatData.targetMode,
areas: chatData.action?.areas,