diff --git a/module/chat-utility.js b/module/chat-utility.js index 86c2384e..cf707dfc 100644 --- a/module/chat-utility.js +++ b/module/chat-utility.js @@ -129,7 +129,7 @@ export class ChatUtility { /* -------------------------------------------- */ static getUsers(filter) { - return Misc.getUsers().filter(filter).map(user => user.id); + return game.users.filter(filter).map(user => user.id); } /* -------------------------------------------- */ diff --git a/module/misc.js b/module/misc.js index 682c9aec..7f851799 100644 --- a/module/misc.js +++ b/module/misc.js @@ -112,16 +112,12 @@ export class Misc { return Misc.firstConnectedGM()?.id ?? game.user.id; } - static getUsers() { - return game.version ? game.users : game.users.entities; - } - static getActiveUser(id) { - return Misc.getUsers().find(u => u.id == id && u.active); + return game.users.find(u => u.id == id && u.active); } static firstConnectedGM() { - return Misc.getUsers().filter(u => u.isGM && u.active).sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active); + return game.users.filter(u => u.isGM && u.active).sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active); } @@ -142,7 +138,7 @@ export class Misc { /* -------------------------------------------- */ static findPlayer(name) { - return Misc.findFirstLike(name, Misc.getUsers(), { description: 'joueur' }); + return Misc.findFirstLike(name, game.users, { description: 'joueur' }); } /* -------------------------------------------- */ diff --git a/module/rdd-combat.js b/module/rdd-combat.js index 88d3e24c..8b3e9cfc 100644 --- a/module/rdd-combat.js +++ b/module/rdd-combat.js @@ -878,7 +878,7 @@ export class RdDCombat { attackerRoll.dmg = RdDBonus.dmg(attackerRoll, this.attacker.getBonusDegat(), this.defender.isEntite()); let defenderRoll = { attackerRoll: attackerRoll, passeArme: attackerRoll.passeArme, show: {} } attackerRoll.show = { - cible: this.target ? this.defender.system.name : 'la cible', + cible: this.target ? this.defender.name : 'la cible', isRecul: (attackerRoll.particuliere == 'force' || attackerRoll.tactique == 'charge') } await RdDResolutionTable.displayRollData(attackerRoll, this.attacker, 'chat-resultat-attaque.html'); diff --git a/module/rdd-roll-encaisser.js b/module/rdd-roll-encaisser.js index 5f2fa08a..8efbc397 100644 --- a/module/rdd-roll-encaisser.js +++ b/module/rdd-roll-encaisser.js @@ -1,4 +1,4 @@ -import { ENTITE_BLURETTE, ENTITE_INCARNE, ENTITE_NONINCARNE } from "./constants.js"; +import { ENTITE_BLURETTE, ENTITE_INCARNE} from "./constants.js"; /** * Extend the base Dialog entity by defining a custom window to perform roll.