Harden the preCreate quantity increase to use source IDs in finding the item

This commit is contained in:
Oliver-Akins 2024-03-22 21:47:29 -06:00
parent 55a64afe02
commit b3e699bc32
3 changed files with 9 additions and 7 deletions

View file

@ -1,7 +1,7 @@
import { DotDungeonItem } from "./GenericItem.mjs";
export class Aspect extends DotDungeonItem {
async _preCreate(...args) {
async _preCreate() {
if (this.isEmbedded) {
if (this.actor.atAspectLimit) {
ui.notifications.error(
@ -14,7 +14,7 @@ export class Aspect extends DotDungeonItem {
return false;
};
return await this.actor?.preItemEmbed(...args);
return await this.actor?.preItemEmbed(this);
};
}
};

View file

@ -1,7 +1,7 @@
export class DotDungeonItem extends Item {
async _preCreate(...args) {
async _preCreate() {
if (this.isEmbedded) {
return await this.actor?.preItemEmbed(...args);
return await this.actor?.preItemEmbed(this);
};
};