[Fix] Reload Fixes (#2099)

This commit is contained in:
WBHarry 2026-07-22 03:36:28 +02:00 committed by GitHub
parent d50545af4e
commit 7f61715adf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 150 additions and 77 deletions

View file

@ -139,7 +139,7 @@ export default class DHRoll extends BaseRoll {
item?.system.hasReload &&
action?.type === 'attack' &&
reloadSetting === CONFIG.DH.SETTINGS.reloadChoices.auto.id;
const needsReload = useReload ? await action?.handleReload?.() : false;
const reloadResult = useReload ? await action?.handleReload?.() : {};
const cls = getDocumentClass('ChatMessage'),
msgData = {
@ -148,7 +148,11 @@ export default class DHRoll extends BaseRoll {
title: roll.title,
speaker: cls.getSpeaker({ actor: roll.data?.parent }),
sound: config.mute ? null : CONFIG.sounds.dice,
system: { ...config, actionDescription, needsReload },
system: {
...config,
actionDescription,
reloadCheckValue: reloadResult.rollValue
},
rolls: [roll]
};