Skip to content

Commit

Permalink
Update dnd5e-character-monitor.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jessev14 committed Sep 2, 2024
1 parent 5a8f592 commit 4ade471
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/dnd5e-character-monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ Hooks.on('renderChatMessage', (app, [html], appData) => {
Hooks.on('preUpdateActor', async (actor, diff, options, userID) => {
if (actor.type !== 'character') return;
if (game.system.id === 'dnd5e' && "isAdvancement" in options) return;
if (game.settings.get(moduleID, 'showToggle') && !game.settings.get(moduleID, 'cmToggle')) return;

const whisper = game.settings.get(moduleID, 'showGMonly')
? game.users.filter(u => u.isGM).map(u => u.id)
Expand Down Expand Up @@ -294,7 +295,8 @@ Hooks.on('preUpdateActor', async (actor, diff, options, userID) => {
});

Hooks.on('updateActor', async (actor, diff, options, userID) => {
if (game.settings.get(moduleID, 'cmToggle') && !game.settings.get(moduleID, 'cmToggle')) return;
if (!game.settings.get(moduleID, 'monitorHP')) return;
if (game.settings.get(moduleID, 'showToggle') && !game.settings.get(moduleID, 'cmToggle')) return;

if (diff.system?.attributes?.hp) {
const previousData = options.dnd5e.hp
Expand Down

0 comments on commit 4ade471

Please sign in to comment.