Make it so that the actor can reject embedded items using the Item pre-create hook

This commit is contained in:
Oliver-Akins 2024-01-13 16:03:43 -07:00
parent 1701547e57
commit 3791a7199c
4 changed files with 43 additions and 12 deletions

View file

@ -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);
};
};