Skip to content

Commit

Permalink
Use WorldThingDamaged instead of WorldThingDied to detect boss kills
Browse files Browse the repository at this point in the history
  • Loading branch information
ToxicFrog committed Jul 18, 2023
1 parent 36d3f12 commit 65898b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions indestructable/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- Fix:
- "max lives per boss kill" did not function correctly when set to 0/unlimited
- boss kills were not reliably detected

# 0.2.7

Expand Down
6 changes: 3 additions & 3 deletions indestructable/ca.ancilla.indestructable/Indestructable.zs
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ class ::IndestructableEventHandler : StaticEventHandler {
}
}

override void WorldThingDied(WorldEvent evt) {
if (!evt.thing.bBOSS || !evt.inflictor) return;
override void WorldThingDamaged(WorldEvent evt) {
if (!evt.thing || !evt.damagesource || !evt.thing.bBOSS || evt.thing.health > 0) return;
let lives = GetInt("indestructable_lives_per_boss");
if (!lives) return;
let pawn = PlayerPawn(evt.inflictor.target);
let pawn = PlayerPawn(evt.damagesource);
if (!pawn) return;
let force = ::IndestructableForce(pawn.FindInventory("::IndestructableForce"));
if (!force) return; // PANIC
Expand Down

0 comments on commit 65898b0

Please sign in to comment.