Skip to content

Commit

Permalink
Break on undefined behavior on breakOverlayRender
Browse files Browse the repository at this point in the history
  • Loading branch information
mclemente committed Aug 31, 2023
1 parent 36a7280 commit b814b98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/HealthMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ function getActorHealth(token) {
* @param {Token} token
*/
export function addCharacter(token) {
if (game.healthEstimate.breakOverlayRender(token)) return;
const breakCondition = game.healthEstimate.breakOverlayRender(token);
if (breakCondition || typeof breakCondition === "undefined") {
return;
}
const { estimate, index, isDead } = getActorHealth(token);
if (estimate) {
game.healthEstimate.actorsCurrentHP[token.id] = {
Expand Down

0 comments on commit b814b98

Please sign in to comment.