From d30226cb33da85513ec0589929e8a93b8c08d2ea Mon Sep 17 00:00:00 2001 From: LeRatierBretonnien Date: Thu, 13 Jun 2024 21:52:48 +0200 Subject: [PATCH] Fix game.users for v12 --- module/misc.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/misc.js b/module/misc.js index 104646bb..9ed3050e 100644 --- a/module/misc.js +++ b/module/misc.js @@ -166,9 +166,9 @@ export class Misc { } static firstConnectedGM() { - if (typeof(game.users) == "object") { - return game.users.find(u => u.isGM && u.active); - } + if (game.users?.activeGM) { + return game.users.activeGM + } return game.users.sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active); } static connectedGMs() {