diff --git a/indestructable/CHANGELOG.md b/indestructable/CHANGELOG.md index bf322bb..b5be013 100644 --- a/indestructable/CHANGELOG.md +++ b/indestructable/CHANGELOG.md @@ -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 diff --git a/indestructable/ca.ancilla.indestructable/Indestructable.zs b/indestructable/ca.ancilla.indestructable/Indestructable.zs index 0198c2a..421c8e8 100644 --- a/indestructable/ca.ancilla.indestructable/Indestructable.zs +++ b/indestructable/ca.ancilla.indestructable/Indestructable.zs @@ -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