Fixed old messages being instantiated with damage rolls as class=roll instead of the new class=baseRoll

This commit is contained in:
WBHarry 2026-07-18 12:48:24 +02:00
parent b7e92cfe0e
commit b2bf102443
2 changed files with 3 additions and 2 deletions

View file

@ -24,7 +24,7 @@ import TokenManager from './module/documents/tokenManager.mjs';
CONFIG.DH = SYSTEM;
CONFIG.TextEditor.enrichers.push(...enricherConfig);
CONFIG.Dice.rolls = [Roll = BaseRoll, DHRoll, DualityRoll, D20Roll, DamageRoll, FateRoll];
CONFIG.Dice.rolls = [BaseRoll, Roll, DHRoll, DualityRoll, D20Roll, DamageRoll, FateRoll];
CONFIG.Dice.daggerheart = {
DHRoll: DHRoll,
DualityRoll: DualityRoll,

View file

@ -192,12 +192,13 @@ export default class DHActorRoll extends foundry.abstract.TypeDataModel {
if (!main && !resources) {
source.damage.main = null;
source.damage.resources = {};
const getRoll = key => {
const damageData = source.damage[key];
const oldRoll = damageData.parts[0]?.roll;
return oldRoll ? JSON.stringify({
...oldRoll,
class: 'BaseRoll',
options: {
...oldRoll.options,
damageTypes: damageData.parts[0].damageTypes ?? []