Make it so that the actor can reject embedded items using the Item pre-create hook
This commit is contained in:
parent
1701547e57
commit
3791a7199c
4 changed files with 43 additions and 12 deletions
|
|
@ -1,14 +1,7 @@
|
|||
/** @this {Item} */
|
||||
async function _preCreate(data, options, user) {
|
||||
if (this.parent.itemTypes.aspect.length > 0) {
|
||||
ui.notifications.error(
|
||||
game.i18n.format(
|
||||
`dotdungeon.notification.error.aspect-limit-reached`,
|
||||
{ limit: 1 }
|
||||
),
|
||||
{ console: false }
|
||||
);
|
||||
return false;
|
||||
/** @this {ItemHandler} */
|
||||
async function _preCreate(_data, _options, _user) {
|
||||
if (this.isEmbedded) {
|
||||
return await this.actor?.preItemEmbed(this);
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue