Dice expression breakdown shows [object Object] instead of constants and operators

Issue #274 resolved
Ben Freeland created an issue

Setup

dnd5e: 1.4.1
obsidian: 5.0.8

Keeping this one short, the function compileExpression in js/module/rolls.js is returning NumericTerm and OperatorTerm terms instead of their values, causing them to be showns as “[object Object]”

Attached is a patch adds the following to the processing of terms in compileExpression:

if (part instanceof NumericTerm) {
    return part.number;
}

if (part instanceof OperatorTerm) {
    return part.operator;
}

Comments (2)

  1. Ben Freeland reporter

    Tested this by creating a feature with a dice expression such as “@abilities.int.mod+@abilities.cha.mod”

  2. Log in to comment