Fix critical bugs from code review

- room.gd: Add signal tracking and explicit cleanup in _exit_tree
- room.gd: Guard _on_enemy_died against race condition after room freed
- player.gd: Set _shield_ready = false on shield activation
- player.gd: Fix coolant zone lambda syntax error
- player.gd: Add apply_knockback() method for Hivemind pulse
- player.gd: Fix coolant zone memory leak (use Timer child)
- hud.gd: Remove deprecated boss bar code
This commit is contained in:
2026-03-11 09:47:37 -04:00
parent e45759980e
commit e11eddf1b4
19 changed files with 162 additions and 120 deletions
+5 -2
View File
@@ -37,6 +37,9 @@ const MINE_AOE := 70.0
const FREEZE_DURATION := 1.5
const SWEEP_PROJ_DAMAGE := 1.0
const MINE_DAMAGE := 1.0
# ---------------------------------------------------------------------------
# State
# ---------------------------------------------------------------------------
@@ -215,7 +218,7 @@ func _spawn_sweep_proj(world_pos: Vector2, vel: Vector2) -> void:
area.add_child(cs)
area.body_entered.connect(func(body: Node) -> void:
if body.is_in_group("player"):
body.take_damage(1.0)
body.take_damage(SWEEP_PROJ_DAMAGE)
proj.queue_free())
proj.add_child(area)
@@ -321,7 +324,7 @@ func _explode_mine(entry: Dictionary) -> void:
if _player != null and is_instance_valid(_player):
var dist := node.global_position.distance_to(_player.global_position)
if dist <= MINE_AOE:
_player.take_damage(1.0)
_player.take_damage(MINE_DAMAGE)
# Brief visual flash for explosion (optional: could add particle later)
var flash := Polygon2D.new()