From 04786a48957f7101d49cfb51f3995002533c1d54 Mon Sep 17 00:00:00 2001 From: Dapoolp Date: Sun, 17 Aug 2025 15:25:23 +0200 Subject: [PATCH] Fix weapon base attack reseting on update --- module/documents/item.mjs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/module/documents/item.mjs b/module/documents/item.mjs index fb558e8c..8492f068 100644 --- a/module/documents/item.mjs +++ b/module/documents/item.mjs @@ -28,6 +28,14 @@ export default class DHItem extends foundry.documents.Item { return doc; } + /* -------------------------------------------- */ + + /** @inheritDoc */ + static migrateData(source) { + if(source.system?.attack && !source.system.attack.type) source.system.attack.type = "attack"; + return super.migrateData(source); + } + /** * @inheritdoc * @param {object} options - Options which modify the getRollData method.