Fix: oubli correction tmr multiples

This commit is contained in:
Vincent Vandemeulebrouck 2021-04-28 00:43:06 +02:00
parent 78d4b48aae
commit c786757db0

View File

@ -116,6 +116,13 @@ export class Misc {
return Misc.data(it)?.data ?? {} 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() { static isElectedUser() {
return game.user.id == Misc.connectedGMOrUser(); return game.user.id == Misc.connectedGMOrUser();
} }