Fix échange de messages de combat

Les actions des joueurs n'étaient pas toujours possibles
à cause de tests multijoueurs insuffisants
This commit is contained in:
Vincent Vandemeulebrouck
2021-01-15 19:10:50 +01:00
parent 9ee1b0250d
commit 7a668eb1cf
2 changed files with 113 additions and 108 deletions

View File

@@ -635,8 +635,6 @@ export class RdDUtility {
static onSocketMesssage(sockmsg) {
console.log(">>>>> MSG RECV", sockmsg);
switch (sockmsg.msg) {
case "msg_encaisser":
return RdDUtility._handleMsgEncaisser(sockmsg.data);
case "msg_gm_chat_message":
return ChatUtility.handleGMChatMessage(sockmsg.data);
case "msg_sync_time":
@@ -749,15 +747,6 @@ export class RdDUtility {
});
}
/* -------------------------------------------- */
static _handleMsgEncaisser(data) {
if (game.user.isGM) { // Seul le GM effectue l'encaissement sur la fiche
let defender = canvas.tokens.get(data.defenderTokenId).actor;
let attacker = data.attackerId ? game.actors.get(data.attackerId) : null;
defender.encaisserDommages(attackerRoll, attacker);
}
}
/* -------------------------------------------- */
static async chatListeners(html) {
RdDCombat.registerChatCallbacks(html);