Skip to content

Commit

Permalink
Merge pull request dmdorman#586 from phBalance/phBalance/in-combat-crash
Browse files Browse the repository at this point in the history
In combat check crashes
  • Loading branch information
phBalance authored Jan 4, 2024
2 parents 621254b + 4fe8237 commit 9ff7630
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion module/actor/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export class HeroSystem6eActor extends Actor {
data.type != "pc" &&
data.system.characteristics.stun.value < -10
) {
let combatant = game.combat.combatants.find(
const combatant = game.combat?.combatants.find(
(o) => o.actorId === data._id,
);
if (combatant && !combatant.defeated) {
Expand Down
4 changes: 2 additions & 2 deletions module/ruler.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ export class HeroRuler {
(automation === "pcEndOnly" && actor.type === "pc")
) {
// Only consume endurance on token's phase, allowing for Knockback movement (which does not consume END)
if (game.combat.combatant.actorId != actor.id)
if (game.combat?.combatant.actorId != actor.id)
continue;

let combatant = game.combat.combatants.find(
const combatant = game.combat?.combatants.find(
(o) => o.actorId === actor.id,
);
if (combatant) {
Expand Down

0 comments on commit 9ff7630

Please sign in to comment.