From 883543d8deb87808e3ffd24a31a8613fc679b070 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 28 Mar 2026 10:20:07 -0400 Subject: [PATCH] Fix nil crash in _play_damage_animations on player concede MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a player is eliminated, the server sends archSpirit: null. player.get("archSpirit", {}) returns null (not {}) when the key exists but its value is null — the default only fires for missing keys. GDScript then throws assigning null to unit: Dictionary. Use `player.get("archSpirit") or {}` which coerces any falsy value (null, missing key) to an empty dict before building the iteration array. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Client/origin-client/scenes/game/game_screen.gd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index 3e87897..1dbf511 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -1704,7 +1704,7 @@ func _play_damage_animations(state: Dictionary) -> bool: var damaged_iids : Dictionary = {} var seen_iids : Dictionary = {} for player: Dictionary in state.get("players", []): - for unit: Dictionary in ([player.get("archSpirit", {})] + player.get("field", [])): + for unit: Dictionary in ([player.get("archSpirit") or {}] + player.get("field", [])): if unit.is_empty(): continue var iid := str(unit.get("instanceId", "")) var new_hp := int(unit.get("currentHealth", 0)) @@ -3543,7 +3543,7 @@ func _on_state_updated(state: Dictionary) -> void: _camera_oriented = true var bw := float(Game.board_width()) var bh := float(Game.board_height()) - var max_dim := max(bw, bh) + var max_dim :Variant = max(bw, bh) # Auto-scale camera distance: larger boards need more distance to see the whole layout. _cam_distance = clampf(max(max_dim, 10.0) * 1.5, 12.0, 30.0) # Pivot shifts the look-at point toward the local player so their row stays