12.0.7 - La propriété d'Astrobazzarh #709

Merged
uberwald merged 6 commits from VincentVk/foundryvtt-reve-de-dragon:v11 into v11 2024-09-01 20:21:05 +02:00
2 changed files with 17 additions and 7 deletions
Showing only changes of commit 8754ea9f5f - Show all commits

View File

@ -1,4 +1,9 @@
# 12.0 # 12.0
## 12.0.7 - La propriété d'Astrobazzarh
- correction des opérations faites à la création d'un Item:
- la durée des queues/rencontres/souffles
- les effets draconiques d'un souffle/queue
- mise à jour des points de tâche des blessures lors des soins
## 12.0.6 - Le bazar d'Astrobazzarh ## 12.0.6 - Le bazar d'Astrobazzarh
- Corrections de l'inventaire en bazar: - Corrections de l'inventaire en bazar:

View File

@ -166,11 +166,12 @@ export class Misc {
} }
static firstConnectedGM() { static firstConnectedGM() {
if (game.users?.activeGM) { if (foundry.utils.isNewerVersion(game.release.version, '12.0')) {
return game.users.activeGM return game.users.activeGM
} }
return game.users.sort(Misc.ascending(u => u.id)).find(u => u.isGM && u.active); return game.users.find(u => u.isGM && u.active);
} }
static connectedGMs() { static connectedGMs() {
return game.users.filter(u => u.isGM && u.active); return game.users.filter(u => u.isGM && u.active);
} }
@ -188,16 +189,20 @@ export class Misc {
* and there is no connected GM * and there is no connected GM
*/ */
static documentIfResponsible(document) { static documentIfResponsible(document) {
if (document instanceof Document) { if (foundry.utils.isNewerVersion(game.release.version, '12.0')) {
if (Misc.isUniqueConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) { if (game.users.activeGM || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document)))
{
return document return document
} }
} }
else if (Misc.isUniqueConnectedGM() || (Misc.connectedGMs().length == 0 && Misc.isOwnerPlayer(document))) {
return document
}
return undefined return undefined
} }
static isOwnerPlayer(actor) { static isOwnerPlayer(document) {
return actor.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER) return document.testUserPermission && document.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)
} }
static isOwnerPlayerOrUniqueConnectedGM(actor) { static isOwnerPlayerOrUniqueConnectedGM(actor) {