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);