From 450c71544dee7026297d255ded09130e67f0410d Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 28 Mar 2026 12:05:57 -0400 Subject: [PATCH] Fix nil crash: int(null) on currentHealth in damage animations unit.get("currentHealth", 0) returns null when the key exists with a null value; int(null) has no valid constructor in GDScript 4. Use explicit null check before casting. 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index f7d5f09..7858d00 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -1709,7 +1709,8 @@ func _play_damage_animations(state: Dictionary) -> bool: for unit: Dictionary in (_arch_list + player.get("field", [])): if unit.is_empty(): continue var iid := str(unit.get("instanceId", "")) - var new_hp := int(unit.get("currentHealth", 0)) + var _hp_v = unit.get("currentHealth") + var new_hp := 0 if _hp_v == null else int(_hp_v) var old_hp : int = _prev_unit_hp.get(iid, new_hp) seen_iids[iid] = true if new_hp < old_hp: