Item ehnance, fixes on acto sheet
This commit is contained in:
@@ -95,6 +95,13 @@ export default class OathHammerActorSheet extends HandlebarsApplicationMixin(fou
|
||||
|
||||
async _onDropItem(item) {
|
||||
const itemData = item.toObject()
|
||||
// Lineage and class are unique: replace any existing item of the same type
|
||||
if (item.type === "lineage" || item.type === "class") {
|
||||
const existing = this.document.itemTypes[item.type]
|
||||
if (existing.length > 0) {
|
||||
await this.document.deleteEmbeddedDocuments("Item", existing.map(i => i.id))
|
||||
}
|
||||
}
|
||||
await this.document.createEmbeddedDocuments("Item", [itemData], { renderSheet: false })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user