Dungeon crawler: EntityDied clears the current boss even when the dead entity is a regular enemy #1031

Closed
opened 2026-08-13 04:47:39 +00:00 by spikerj · 1 comment
Owner

DungeonCrawlerComponent.handleServerEntityDied removes a matching enemy when event.entityId matches, then unconditionally tears down currentBossInstance if it is set — it never checks whether event.entityId is the boss.

Result: any enemy death while a boss is spawned also plays boss-death VFX, removes the boss model, and clears currentBoss. Characterized in dungeon-crawler.server-handlers.spec.ts (wave 7 a1).

const enemy = this.enemies.find(...);
if (enemy) { /* remove enemy */ }

if (this.currentBossInstance) {
  // runs for every EntityDied, not just the boss
}

Expected: only run the boss-death path when the dead entity is the boss.

`DungeonCrawlerComponent.handleServerEntityDied` removes a matching enemy when `event.entityId` matches, then **unconditionally** tears down `currentBossInstance` if it is set — it never checks whether `event.entityId` is the boss. Result: any enemy death while a boss is spawned also plays boss-death VFX, removes the boss model, and clears `currentBoss`. Characterized in `dungeon-crawler.server-handlers.spec.ts` (wave 7 a1). ```ts const enemy = this.enemies.find(...); if (enemy) { /* remove enemy */ } if (this.currentBossInstance) { // runs for every EntityDied, not just the boss } ``` Expected: only run the boss-death path when the dead entity is the boss.
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.