Amélioration des remoteActorCall

This commit is contained in:
2025-12-13 02:43:58 +01:00
parent bb51d1c1d0
commit c61cc5da18
2 changed files with 17 additions and 16 deletions

View File

@@ -200,10 +200,7 @@ export class Misc {
}
static firstConnectedGM() {
if (foundry.utils.isNewerVersion(game.release.version, '12.0')) {
return game.users.activeGM
}
return game.users.find(u => u.isGM && u.active);
return game.users.activeGM
}
static connectedGMs() {
@@ -223,7 +220,7 @@ export class Misc {
* and there is no connected GM
*/
static documentIfResponsible(document) {
if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isFirstOwnerPlayer(document))) {
if (game.users.activeGM || (Misc.connectedGMs().length == 0 && Misc.isFirstOwnerPlayer(document))) {
return document
}
return undefined
@@ -252,15 +249,15 @@ export class Misc {
* @returns true pour un seul utilisateur: le premier GM connecté par ordre d'id
*/
static isFirstConnectedGM() {
return game.user == Misc.firstConnectedGM();
return game.user == game.users.activeGM
}
static hasConnectedGM() {
return Misc.firstConnectedGM();
return game.users.activeGM
}
static firstConnectedGMId() {
return Misc.firstConnectedGM()?.id;
return game.users.activeGM?.id;
}
/* -------------------------------------------- */