Skip to content

Commit

Permalink
Disable collision just before firing death events.
Browse files Browse the repository at this point in the history
  • Loading branch information
steffen-wilke committed Dec 6, 2021
1 parent 6f13635 commit 7047c83
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ public void die() {

this.getHitPoints().modifyBaseValue(new AttributeModifier<>(Modification.SET, 0));
this.fireDeathEvent();

this.setCollision(false);
}

@Override
Expand Down Expand Up @@ -193,13 +191,14 @@ public void hit(final int damage, final Ability ability) {

if (this.isDead()) {
this.fireDeathEvent();
this.setCollision(false);
}

this.lastHit = Game.time().now();
}

private void fireDeathEvent() {
this.setCollision(false);

for (final CombatEntityListener listener : this.listeners) {
listener.death(this);
}
Expand Down

0 comments on commit 7047c83

Please sign in to comment.