mineur: plus besoin de joueur pour la defense
This commit is contained in:
parent
c77d5e3c93
commit
1d10c0bd3f
@ -491,20 +491,14 @@ export class RdDCombat {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static onMsgDefense(msg) {
|
static onMsgDefense(msg) {
|
||||||
let defenderToken = canvas.tokens.get(msg.defenderTokenId);
|
let defenderToken = canvas.tokens.get(msg.defenderTokenId);
|
||||||
if (defenderToken) {
|
if (defenderToken && Misc.isElectedUser()) {
|
||||||
if (!game.user.isGM && !game.user.character) { // vérification / sanity check
|
const rddCombat = RdDCombat.createForAttackerAndDefender(msg.attackerId, msg.defenderTokenId);
|
||||||
ui.notifications.error("Le joueur " + game.user.name + " n'est connecté à aucun personnage. Impossible de continuer.");
|
if (rddCombat) {
|
||||||
return;
|
const defenderRoll = msg.defenderRoll;
|
||||||
}
|
RdDCombat._storeAttaque(msg.attackerId, defenderRoll.attackerRoll);
|
||||||
if (Misc.isElectedUser()) {
|
RdDCombat._storeDefense(defenderRoll);
|
||||||
const rddCombat = RdDCombat.createForAttackerAndDefender(msg.attackerId, msg.defenderTokenId);
|
rddCombat.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
||||||
if (rddCombat) {
|
rddCombat._chatMessageDefense(msg.paramChatDefense);
|
||||||
const defenderRoll = msg.defenderRoll;
|
|
||||||
RdDCombat._storeAttaque(msg.attackerId, defenderRoll.attackerRoll);
|
|
||||||
RdDCombat._storeDefense(defenderRoll);
|
|
||||||
rddCombat.removeChatMessageActionsPasseArme(defenderRoll.passeArme);
|
|
||||||
rddCombat._chatMessageDefense(msg.paramChatDefense);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user