Update scripts
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
let skill = `Métier (${this.item.parenthesesText})`
|
||||
let skill = `${game.i18n.localize("NAME.Trade")} (${this.item.parenthesesText})`
|
||||
let currentCareer = this.actor.system.currentCareer;
|
||||
let existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);
|
||||
|
||||
if (!currentCareer) return
|
||||
|
||||
|
||||
let inCurrentCareer = currentCareer.system.skills.includes(skill);
|
||||
let inCurrentCareer = currentCareer.system.skills.concat(currentCareer.system.addedSkills).includes(skill);
|
||||
let craftsmanAdded = this.actor.getFlag("wfrp4e", "craftsmanAdded") || {};
|
||||
if (existingSkill && inCurrentCareer && !craftsmanAdded[existingSkill.name])
|
||||
{
|
||||
@ -14,6 +14,6 @@ if (existingSkill && inCurrentCareer && !craftsmanAdded[existingSkill.name])
|
||||
else
|
||||
{
|
||||
craftsmanAdded[skill] = true;
|
||||
currentCareer.system.skills.push(skill);
|
||||
setProperty(this.actor, "flags.wfrp4e.craftsmanAdded", craftsmanAdded)
|
||||
currentCareer.system.addedSkills.push(skill);
|
||||
foundry.utils.setProperty(this.actor, "flags.wfrp4e.craftsmanAdded", craftsmanAdded)
|
||||
}
|
Reference in New Issue
Block a user