From a91264cd82579a1d28c555f7499948e0412dad71 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 24 Nov 2024 16:27:28 +0100 Subject: [PATCH] Correction erreur onMsgEncaisser MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pas d'actor passé pour déterminer si on doit gérer le message --- module/rdd-combat.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 78c27dcb..c64a0b4e 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -435,11 +435,10 @@ export class RdDCombat { /* -------------------------------------------- */ static onMsgEncaisser(msg) { - if (Misc.isOwnerPlayerOrUniqueConnectedGM()) { + let defender = canvas.tokens.get(msg.defenderToken.id).actor; + if (Misc.isOwnerPlayerOrUniqueConnectedGM(defender)) { let attackerRoll = msg.attackerRoll; let attacker = msg.attackerId ? game.actors.get(msg.attackerId) : undefined; - let defender = canvas.tokens.get(msg.defenderToken.id).actor; - defender.encaisserDommages(attackerRoll, attacker, msg.attackerToken); const rddCombat = RdDCombat.rddCombatForAttackerAndDefender(msg.attackerId, msg.attackerToken.id, msg.defenderToken.id); rddCombat?.removeChatMessageActionsPasseArme(attackerRoll.passeArme);