mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Show notification when invalid item types are added to actors (#1807)
This commit is contained in:
parent
7d5cdeb09d
commit
aa8771bf0d
10 changed files with 41 additions and 25 deletions
|
|
@ -107,7 +107,8 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
|
|||
hasResistances: true,
|
||||
hasAttribution: false,
|
||||
hasLimitedView: true,
|
||||
usesSize: false
|
||||
usesSize: false,
|
||||
hasInventory: false
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -168,6 +169,11 @@ export default class BaseDataActor extends foundry.abstract.TypeDataModel {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
isItemValid(source) {
|
||||
const inventoryTypes = ['weapon', 'armor', 'consumable', 'loot'];
|
||||
return this.metadata.hasInventory && inventoryTypes.includes(source.type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtain a data object used to evaluate any dice rolls associated with this Item Type
|
||||
* @param {object} [options] - Options which modify the getRollData method.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue