From c786757db0a212cd43ae9e0d685140dc8970bf1c Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Wed, 28 Apr 2021 00:43:06 +0200 Subject: [PATCH] Fix: oubli correction tmr multiples --- module/misc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/module/misc.js b/module/misc.js index 72335ae4..85c490af 100644 --- a/module/misc.js +++ b/module/misc.js @@ -116,6 +116,13 @@ export class Misc { return Misc.data(it)?.data ?? {} } + static connectedGMOrUser(ownerId = undefined) { + if (ownerId && game.user.id == ownerId){ + return ownerId; + } + return (game.user.isGM ? game.user.id : game.users.entities.find(u => u.isGM && u.active)?.id) ?? game.user.id; + } + static isElectedUser() { return game.user.id == Misc.connectedGMOrUser(); }