Added remaining options and fixed secure loading of dice models (#413)

This commit is contained in:
WBHarry 2025-07-26 04:12:22 +02:00 committed by GitHub
parent dddee78356
commit bf31ced3df
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 167 additions and 100 deletions

View file

@ -16,14 +16,19 @@ export default class DamageRoll extends DHRoll {
for (const roll of config.roll) await roll.roll.evaluate();
}
roll._evaluated = true;
const parts = config.roll.map(r => this.postEvaluate(r));
const parts = [];
for (let r of config.roll) {
const part = this.postEvaluate(r);
parts.push(part);
}
config.roll = this.unifyDamageRoll(parts);
}
static postEvaluate(roll, config = {}) {
static async postEvaluate(roll, config = {}) {
return {
...roll,
...super.postEvaluate(roll.roll, config),
...(await super.postEvaluate(roll.roll, config)),
damageTypes: [...(roll.damageTypes ?? [])],
roll: roll.roll,
type: config.type,