Fix #70 : effect OK for dmr roll

This commit is contained in:
2022-09-28 20:14:24 +02:00
parent fb69f24fce
commit 18a69ba993
3 changed files with 12 additions and 8 deletions

View File

@@ -144,9 +144,12 @@ export class PegasusUtility {
static updateEffectsBonusDice(rollData) {
let newDicePool = rollData.dicePool.filter(dice => dice.name != "effect-bonus-dice")
for (let effect of rollData.effectsList) {
if (effect && effect.applied && effect.type == "effect" && effect.effect.system.bonusdice) {
if (effect && effect.applied && effect.type == "effect" && effect.effect && effect.effect.system.bonusdice) {
newDicePool = newDicePool.concat( this.buildDicePool("effect-bonus-dice", effect.effect.system.effectlevel, 0, effect.effect.name ))
}
if (effect && effect.applied && effect.type == "effect" && effect.value && effect.isdynamic) {
newDicePool = newDicePool.concat( this.buildDicePool("effect-bonus-dice", effect.value, 0, effect.name ))
}
}
rollData.dicePool = newDicePool
}