Fixed so rerolling damage doesn't make damageParts an object

This commit is contained in:
WBHarry 2025-08-15 21:16:44 +02:00
parent 006f9dde1f
commit 3f0457b8b9

View file

@ -164,7 +164,7 @@ export default class DamageRoll extends DHRoll {
const change = c.changes.find(ch => ch.key === 'system.bonuses.rally'); const change = c.changes.find(ch => ch.key === 'system.bonuses.rally');
if (change) a.push({ value: c.id, label: change.value }); if (change) a.push({ value: c.id, label: change.value });
return a; return a;
}, []) }, []);
if (rallyChoices.length) { if (rallyChoices.length) {
mods.rally = { mods.rally = {
label: 'DAGGERHEART.CLASS.Feature.rallyDice', label: 'DAGGERHEART.CLASS.Feature.rallyDice',
@ -322,11 +322,13 @@ export default class DamageRoll extends DHRoll {
[`system.damage.${damageType}`]: { [`system.damage.${damageType}`]: {
...updateMessage, ...updateMessage,
total: parsedRoll.total, total: parsedRoll.total,
[`parts.${part}`]: { parts: [
{
...rollPart, ...rollPart,
total: parsedRoll.total, total: parsedRoll.total,
dice: rerolledDice dice: rerolledDice
} }
]
} }
}); });
} }