greedyj4ck / DEGENESIS-FoundryVTT

DEGENESIS: Rebirth system for Foundry Virtual Tabletop
26 stars 22 forks source link

Weapons with no damageBonus error on roll #30

Closed Mjb141 closed 3 years ago

Mjb141 commented 3 years ago

Think there's a bug in the weapon rolling. Weapons with set damage (i.e no +F etc) don't work - damageBonus = "" on the item, which results in TypeError: Cannot read property 'calculate' of undefined at item-degenesis.js:160. That is this line (item-degenesis.js:160) return baseValue + this.DamageBonus.calculate(bodyTotal + forceTotal, triggers); That property is set with (item-degenesis.js:371):

get DamageBonus() {
        return DEGENESIS.damageModifiers[this.damageBonus]
    }

so this.damageBonus. When adding a damageBonus option (e..g +F) this is no longer an issue.

Without damageBonus: https://cdn.discordapp.com/attachments/787397861155274792/846142312413528104/unknown.png

With damageBonus: https://cdn.discordapp.com/attachments/787397861155274792/846142452729643048/unknown.png