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
+2 -3
View File
@@ -15,11 +15,10 @@ func _draw() -> void:
func _on_body_entered(body: Node) -> void:
if not body.is_in_group("player") or item == null:
return
RunManager.collect_item(item)
RunManager.collect_item(item) # Triggers item_collected signal -> player_stats recalculates
if item.heal_on_pickup > 0.0:
body.stats.heal(item.heal_on_pickup)
body.stats.recalculate()
EventBus.player_health_changed.emit(body.stats.current_health, body.stats.max_health)
EventBus.player_health_changed.emit(body.stats.current_health, body.stats.max_health)
_show_pickup_label()
queue_free()
+2 -3
View File
@@ -73,11 +73,10 @@ func _attempt_purchase() -> void:
if player == null:
return
RunManager.collect_item(item)
RunManager.collect_item(item) # Triggers item_collected signal -> player_stats recalculates
if item.heal_on_pickup > 0.0:
player.stats.heal(item.heal_on_pickup)
player.stats.recalculate()
EventBus.player_health_changed.emit(player.stats.current_health, player.stats.max_health)
EventBus.player_health_changed.emit(player.stats.current_health, player.stats.max_health)
_sold = true
_player_in_range = false