diff --git a/module/misc.js b/module/misc.js index 76a93ff3..df4301ff 100644 --- a/module/misc.js +++ b/module/misc.js @@ -189,13 +189,7 @@ export class Misc { * and there is no connected GM */ static documentIfResponsible(document) { - if (foundry.utils.isNewerVersion(game.release.version, '12.0')) { - if (game.users.activeGM || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) - { - return document - } - } - else if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) { + if (Misc.isFirstConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isFirstOwnerPlayer(document))) { return document } return undefined @@ -205,8 +199,15 @@ export class Misc { return document.testUserPermission && document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER) } + static isFirstOwnerPlayer(document) { + if (!document.testUserPermission){ + return false + } + return game.users.filter(u => document.testUserPermission(u, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)) == game.user + } + static isOwnerPlayerOrUniqueConnectedGM(actor) { - return Misc.isOwnerPlayer(actor) ?? Misc.isFirstConnectedGM(); + return Misc.isFirstOwnerPlayer(actor) ?? Misc.isFirstConnectedGM(); } /**