Skip to content

Commit

Permalink
Fixed minions not dying on any amount of damage
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Oct 4, 2023
1 parent 4320779 commit 529dcf1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/minion.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ export function initializeMinions() {

});

Hooks.on("preUpdateToken", (doc, change) => {
const actorIsMinion = api.isMinion(doc.actor);
Hooks.on("preUpdateActor", (doc, change) => {
const actorIsMinion = api.isMinion(doc);
if (!actorIsMinion || !hasProperty(change, "system.attributes.hp.value")) return true;
if (getProperty(change, "system.attributes.hp.value") < getProperty(doc.actor, "system.attributes.hp.value")) {
if (getProperty(change, "system.attributes.hp.value") < getProperty(doc, "system.attributes.hp.value")) {
change["system.attributes.hp.value"] = 0;
}
return true;
Expand Down

0 comments on commit 529dcf1

Please sign in to comment.