From fcb9adf5037618d12afb737df1c758c8b933cf6d Mon Sep 17 00:00:00 2001 From: Forien Date: Wed, 26 Jul 2023 07:16:10 +0200 Subject: [PATCH] fixed Ammo Swapper not updating when character got new ammo type --- dist/modules/ammo-swapper.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dist/modules/ammo-swapper.mjs b/dist/modules/ammo-swapper.mjs index d0b4aa1..c87881e 100644 --- a/dist/modules/ammo-swapper.mjs +++ b/dist/modules/ammo-swapper.mjs @@ -26,6 +26,10 @@ Hooks.on("updateUser", (user, data, _options, _userId) => { if (Object.keys(data).includes('character')) game.modules.get(constants.moduleId).api?.initializeAmmoSwapper(); }); +Hooks.on("createItem", (item, _options, _userId) => { + if (item.actor?.id === game.user.character?.id) game.modules.get(constants.moduleId).api?.render(); +}); + Hooks.on("updateItem", (item, _data, _diff, _userId) => { if (item.actor?.id === game.user.character?.id) game.modules.get(constants.moduleId).api?.render(); }); \ No newline at end of file