mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-21 18:09:54 +02:00
[Fix] Companion Rolls (#1982)
Some checks failed
Project CI / build (24.x) (push) Has been cancelled
Some checks failed
Project CI / build (24.x) (push) Has been cancelled
This commit is contained in:
parent
afd8a83241
commit
9a220b4e16
2 changed files with 9 additions and 11 deletions
|
|
@ -224,7 +224,8 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async submitRoll() {
|
static async submitRoll(event) {
|
||||||
|
event.preventDefault();
|
||||||
await this.close({ submitted: true });
|
await this.close({ submitted: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -100,16 +100,13 @@ export default class D20Roll extends DHRoll {
|
||||||
|
|
||||||
this.options.roll.modifiers = this.applyBaseBonus();
|
this.options.roll.modifiers = this.applyBaseBonus();
|
||||||
|
|
||||||
const actorExperiences = this.options.roll.companionRoll
|
let actorExperiences = this.options.data.system?.experiences ?? {};
|
||||||
? (this.options.data?.companion?.system.experiences ?? {})
|
if (this.options.roll.companionRoll) {
|
||||||
: (this.options.data.system?.experiences ?? {});
|
const companion = typeof this.options.data.companion === 'string' ?
|
||||||
this.options.experiences?.forEach(m => {
|
foundry.utils.fromUuidSync(this.options.data.companion) :
|
||||||
if (actorExperiences[m])
|
this.options.data.companion;
|
||||||
this.options.roll.modifiers.push({
|
actorExperiences = companion?.system?.experiences ?? {};
|
||||||
label: actorExperiences[m].name,
|
}
|
||||||
value: actorExperiences[m].value
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
this.addModifiers();
|
this.addModifiers();
|
||||||
if (this.options.extraFormula) {
|
if (this.options.extraFormula) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue