I hate companions. Should work now (#1576)

This commit is contained in:
WBHarry 2026-01-24 20:21:45 +01:00 committed by GitHub
parent 37ae40be8b
commit d43a4994ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 18 additions and 7 deletions

View file

@ -109,11 +109,17 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
context.roll = this.roll;
context.rollType = this.roll?.constructor.name;
context.rallyDie = this.roll.rallyChoices;
const experiences = this.config.data?.system?.experiences || {};
const actorExperiences = this.config.data?.system?.experiences || {};
const companionExperiences = this.config.roll.companionRoll
? (this.config.data?.companion?.system.experiences ?? {})
: null;
const experiences = companionExperiences ?? actorExperiences;
context.experiences = Object.keys(experiences).map(id => ({
id,
...experiences[id]
}));
context.selectedExperiences = this.config.experiences;
context.advantage = this.config.roll?.advantage;
context.disadvantage = this.config.roll?.disadvantage;