Fix: utiliser les compétences des humanoïdes

Utiliser les compétences de l'acteur empêchait l'édition des armes
(et objets liés à une compétence) stockées sur un animal, dans un
véhicule, ou dans un commerce
This commit is contained in:
Vincent Vandemeulebrouck 2023-02-11 01:18:05 +01:00
parent f229537206
commit 2ffa0d8dc7

View File

@ -99,7 +99,7 @@ export class RdDItemSheet extends ItemSheet {
options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable) options: RdDSheetUtility.mergeDocumentRights(this.options, this.item, this.isEditable)
} }
const competences = await SystemCompendiums.getCompetences(this.actor?.type); const competences = await SystemCompendiums.getCompetences('personnage');
formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences() formData.categorieCompetences = RdDItemCompetence.getCategorieCompetences()
if (this.item.type == 'tache' || this.item.type == 'livre' || this.item.type == 'meditation' || this.item.type == 'oeuvre') { if (this.item.type == 'tache' || this.item.type == 'livre' || this.item.type == 'meditation' || this.item.type == 'oeuvre') {
formData.caracList = duplicate(game.system.model.Actor.personnage.carac) formData.caracList = duplicate(game.system.model.Actor.personnage.carac)
@ -107,7 +107,7 @@ export class RdDItemSheet extends ItemSheet {
formData.competences = competences; formData.competences = competences;
} }
if (this.item.type == 'arme') { if (this.item.type == 'arme') {
formData.competences = competences.filter(it => RdDItemCompetence.isCompetenceArme(it)); formData.competences = competences.filter(it => RdDItemCompetence.isCompetenceArme(it))
} }
if (['sort', 'sortreserve'].includes(this.item.type)) { if (['sort', 'sortreserve'].includes(this.item.type)) {
formData.competences = competences.filter(it => RdDItemCompetence.isDraconic(it)); formData.competences = competences.filter(it => RdDItemCompetence.isDraconic(it));