Fix usable checks on adversary features and locked compendium actors

This commit is contained in:
Carlos Fernandez 2026-05-26 05:11:09 -04:00
parent e529dd0f88
commit b5b21f482f
3 changed files with 11 additions and 5 deletions

View file

@ -73,8 +73,10 @@ export default class DHItem extends foundry.documents.Item {
/** Returns true if the item can be used */
get usable() {
const actor = this.actor;
const actionsList = this.system.actionsList;
return this.isOwner && actor?.type === 'character' && (actionsList?.size || actionsList?.length);
const pack = actor?.pack ? game.packs.get(actor.pack) : null;
const hasActions = this.system.actionsList?.size || this.system.actionsList?.length;
const isValidType = actor?.type === 'character' || this.type === 'feature';
return !pack?.locked && this.isOwner && isValidType && hasActions;
}
/** @inheritdoc */