mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-18 16:09:03 +01:00
Improved to properly handle theoretical additional damage parts
This commit is contained in:
parent
3f0457b8b9
commit
a944e86961
1 changed files with 9 additions and 7 deletions
|
|
@ -318,17 +318,19 @@ export default class DamageRoll extends DHRoll {
|
|||
});
|
||||
|
||||
const updateMessage = game.messages.get(message._id);
|
||||
const damageParts = updateMessage.system.damage[damageType].parts.map((damagePart, index) => {
|
||||
if (index !== Number(part)) return damagePart;
|
||||
return {
|
||||
...rollPart,
|
||||
total: parsedRoll.total,
|
||||
dice: rerolledDice
|
||||
};
|
||||
});
|
||||
await updateMessage.update({
|
||||
[`system.damage.${damageType}`]: {
|
||||
...updateMessage,
|
||||
total: parsedRoll.total,
|
||||
parts: [
|
||||
{
|
||||
...rollPart,
|
||||
total: parsedRoll.total,
|
||||
dice: rerolledDice
|
||||
}
|
||||
]
|
||||
parts: damageParts
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue