Implement a button to create items of a specific subtype in the player inventory (closes #120)
This commit is contained in:
parent
b3e699bc32
commit
96f5b17785
9 changed files with 73 additions and 21 deletions
|
|
@ -1,6 +1,7 @@
|
|||
export class DotDungeonActor extends Actor {
|
||||
async createEmbeddedItem(defaults, opts = {}) {
|
||||
let items = await this.createEmbeddedDocuments(`Item`, defaults);
|
||||
if (!Array.isArray(items)) items = items ? [items] : [];
|
||||
if (items.length == 0) {
|
||||
throw new Error(`Failed to create any items`);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue