From 8abe2145eed8869fd1553b8d4b9333dc39f5d623 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sat, 9 Oct 2021 00:21:26 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20cat=C3=A9gorie=20d'arme=20des=20cr=C3=A9a?= =?UTF-8?q?tures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Régression rendant la parade bouclier des armes naturelles impossible --- module/item-competencecreature.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/module/item-competencecreature.js b/module/item-competencecreature.js index d9aaf53b..30fcce60 100644 --- a/module/item-competencecreature.js +++ b/module/item-competencecreature.js @@ -17,23 +17,23 @@ export class RdDItemCompetenceCreature extends Item { } /* -------------------------------------------- */ - static toArme(itemData) { - if (RdDItemCompetenceCreature.isCompetenceAttaque(itemData)) { - itemData = Misc.data(itemData); - let arme = { name: itemData.name, data: duplicate(itemData) }; + static toArme(item) { + if (RdDItemCompetenceCreature.isCompetenceAttaque(item)) { + // si c'est un Item compétence: cloner pour ne pas modifier lma compétence + let arme = Misc.data( (item instanceof Item) ? item.clone(): item); mergeObject(arme.data, { - competence: itemData.name, + competence: arme.name, resistance: 100, equipe: true, - dommagesReels: itemData.data.dommages, + dommagesReels: arme.data.dommages, penetration: 0, force: 0, rapide: true }); return arme; } - console.error("RdDItemCompetenceCreature.toArme(", itemData, ") : impossible de transformer l'Item en arme"); + console.error("RdDItemCompetenceCreature.toArme(", item, ") : impossible de transformer l'Item en arme"); return undefined; }