Skip to content

Commit

Permalink
fixed Ammo Swapper not updating when character got new ammo type
Browse files Browse the repository at this point in the history
  • Loading branch information
Forien committed Jul 26, 2023
1 parent 7082d9c commit fcb9adf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dist/modules/ammo-swapper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});

0 comments on commit fcb9adf

Please sign in to comment.