Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
theripper93 committed Sep 21, 2024
1 parent 6b78e90 commit 0a3930d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/CombatBooster.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ Hooks.on("updateActor", async function (actor, updates) {
if (!token || !combatant) return;
const hp = CombatBooster.getHpVal(updates);
if (hp === 0) {
if (!combatant.defeated && game.settings.get("combatbooster", "markDefeated")) await combatant.toggleDefeated();
if (!combatant.defeated && game.settings.get("combatbooster", "markDefeated")) await ui.combat._onToggleDefeatedStatus(combatant);
if (game.settings.get("combatbooster", "moveToPile")) {
token.release();
token.object?.release();
const pileToken = canvas.tokens.placeables.find((t) => t.name.toLowerCase() === "pile");
const { x, y } = pileToken ? pileToken.document : { x: 0, y: 0 };
await token.update({ x, y }, { animate: false });
}
} else if (hp > 0 && game.settings.get("combatbooster", "markDefeated")) {
if (combatant.defeated) await combatant.toggleDefeated();
if (combatant.defeated) await ui.combat._onToggleDefeatedStatus(combatant);
}
} catch (error) {
}
Expand Down

0 comments on commit 0a3930d

Please sign in to comment.