Version 12.0.23 - La bibliothèque d'Astrobazzarh #723
@ -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();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user