Fix damage save

This commit is contained in:
Dapoolp 2025-07-19 17:40:35 +02:00
parent c1eac701aa
commit 851a25aa64

View file

@ -215,10 +215,10 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
if (message.system.onSave && message.system.targets.find(t => t.id === target.id)?.saved?.success === true) {
const mod = CONFIG.DH.ACTIONS.damageOnSave[message.system.onSave]?.mod ?? 1;
Object.entries(damages).forEach((k,v) => {
let newTotal = 0;
v.total = 0;
v.forEach(part => {
v.total = Math.ceil(v.total * mod);
newTotal += v.total;
part.total = Math.ceil(part.total * mod);
v.total += part.total;
})
})
}