This commit is contained in:
Dapoolp 2025-07-08 20:42:19 +02:00
parent 62b25ccbfc
commit a3984f30a4
2 changed files with 8 additions and 8 deletions

View file

@ -219,8 +219,8 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
static async armorStackQuery({actorId, damage}) { static async armorStackQuery({actorId, damage}) {
return new Promise(async (resolve, reject) => { return new Promise(async (resolve, reject) => {
const actor = await fromUuid(actorId); const actor = await fromUuid(actorId);
if(!actor || !actor?.testUserPermission(game.user, CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER)) reject(); if(!actor || !actor?.isOwner) reject();
new DamageReductionDialog(resolve, reject, actor, damage).render(true); new DamageReductionDialog(resolve, reject, actor, damage).render({ force: true });
}) })
} }
} }

View file

@ -4,15 +4,16 @@ import DamageReductionDialog from '../applications/dialogs/damageReductionDialog
import { LevelOptionType } from '../data/levelTier.mjs'; import { LevelOptionType } from '../data/levelTier.mjs';
import DHFeature from '../data/item/feature.mjs'; import DHFeature from '../data/item/feature.mjs';
<<<<<<< HEAD
export default class DhpActor extends Actor { export default class DhpActor extends Actor {
// Return the first active player with the ownership
/**
* Return the first Actor active owner.
*/
get owner() { get owner() {
const user = this.hasPlayerOwner && game.users?.players.find(p => p.active && this.ownership[p.id ?? ""] === CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER); const user = this.hasPlayerOwner && game.users.players.find(u => this.testUserPermission(u, "OWNER") && u.active);;
if(!user) return game.user.isGM ? game.user : null; if(!user) return game.user.isGM ? game.user : null;
return user; return user;
======= }
export default class DhpActor extends foundry.documents.Actor {
/** /**
* Whether this actor is an NPC. * Whether this actor is an NPC.
@ -20,7 +21,6 @@ export default class DhpActor extends foundry.documents.Actor {
*/ */
get isNPC() { get isNPC() {
return this.system.metadata.isNPC; return this.system.metadata.isNPC;
>>>>>>> main
} }
async _preCreate(data, options, user) { async _preCreate(data, options, user) {