Fixed so that DamageTypes are retained and joined together throughout TagTeamDialog

This commit is contained in:
WBHarry 2026-07-17 22:23:53 +02:00
parent 7afc98ed93
commit e6dcb0f9a5
2 changed files with 12 additions and 1 deletions

View file

@ -588,6 +588,7 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
criticalTerm
]);
newDamage.types[key].options = foundry.utils.deepClone(origDamage.types[key].options);
}
return newDamage;
@ -650,6 +651,16 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
new foundry.dice.terms.OperatorTerm({ operator: '+' }),
...baseSecondaryRoll.damageRollData.types[key].terms
]);
/* Joining the roll.options of both rolls */
const joinedDamageTypes = new Set([
...baseMainRoll.damageRollData.types[key].options.damageTypes,
...baseSecondaryRoll.damageRollData.types[key].options.damageTypes
]);
mainRoll.damageRollData.types[key].options = {
...baseMainRoll.damageRollData.types[key].options,
damageTypes: [...joinedDamageTypes]
};
} else {
mainRoll.damageRollData.types[key] = damage;
}

View file

@ -19,7 +19,7 @@ export default class DamageRoll extends DHRoll {
for (const roll of config.roll) {
await roll.roll.evaluate();
roll.roll.options = { damageTypes: roll.damageTypes ?? [] };
roll.roll.options = { damageTypes: roll.damageTypes ? [...roll.damageTypes] : [] };
if (!config.damage?.types) config.damage = { types: {} };
config.damage.types[roll.applyTo] = roll.roll;