diff --git a/system/actor/wod-actor-base.js b/system/actor/wod-actor-base.js index 69c40f24..615f22aa 100644 --- a/system/actor/wod-actor-base.js +++ b/system/actor/wod-actor-base.js @@ -435,7 +435,18 @@ export class WoDActor extends HandlebarsApplicationMixin(foundry.applications.sh const blacklist = itemsList[itemType].excludedActorTypes // If the whitelist contains any entries, we can check to make sure this actor type is allowed for the item - if (!foundry.utils.isEmpty(whitelist) && whitelist.indexOf(actorType) === -1) { + // We go through the base actor type, then subtypes - if we match to any of them, we allow the item to be + // added to the actor. + // + // We don't need to add this logic to the blacklist because the blacklist only needs to check against the base types. + if (!foundry.utils.isEmpty(whitelist) && + // This is just a general check against the base actorType + !whitelist.includes(actorType) && + // If the actor is an SPC, check against the spcType + !(actorType === 'spc' && whitelist.includes(this.actor.system.spcType)) && + // If the actor is a Group sheet, check against the groupType + !(actorType === 'group' && whitelist.includes(this.actor.system.groupType)) + ) { ui.notifications.warn(game.i18n.format('WOD5E.ItemsList.ItemCannotBeDroppedOnActor', { string1: itemType, string2: actorType diff --git a/system/api/def/itemtypes.js b/system/api/def/itemtypes.js index b8e29524..131de61a 100644 --- a/system/api/def/itemtypes.js +++ b/system/api/def/itemtypes.js @@ -143,8 +143,7 @@ export class ItemTypes extends BaseDefinitionClass { img: 'systems/vtm5e/assets/icons/items/discipline.png', types: ['power'], sheetClass: DisciplineItemSheet, - restrictedActorTypes: ['vampire', 'ghoul'], - excludedActorTypes: ['spc'] + restrictedActorTypes: ['vampire', 'ghoul'] } static boon = { @@ -182,8 +181,7 @@ export class ItemTypes extends BaseDefinitionClass { img: 'systems/vtm5e/assets/icons/items/edge.png', types: ['perk'], sheetClass: PerkItemSheet, - restrictedActorTypes: ['hunter'], - excludedActorTypes: ['spc'] + restrictedActorTypes: ['hunter'] } static edgepool = { @@ -230,8 +228,7 @@ export class ItemTypes extends BaseDefinitionClass { img: 'systems/vtm5e/assets/icons/items/gift.png', types: ['gift'], sheetClass: GiftItemSheet, - restrictedActorTypes: ['werewolf'], - excludedActorTypes: ['spc'] + restrictedActorTypes: ['werewolf'] } }