diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index f66cfed..5ca595e 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -302,6 +302,16 @@ const ANIM_ALIASES : Dictionary = { # ── Lifecycle ───────────────────────────────────────────────────────────────── func _ready() -> void: + # Connect critical game signals first — before anything that could error — + # so state pushes are never missed even if later setup fails. + Game.state_updated.connect(_on_state_updated) + Game.game_over.connect(_on_game_over) + Game.session_abandoned.connect(_on_session_abandoned) + Game.opponent_inactive.connect(_on_opponent_inactive) + Game.inactive_warning.connect(_on_inactive_warning) + Game.both_idle_warning.connect(_on_both_idle_warning) + Game.player_eliminated.connect(_on_player_eliminated) + _setup_environment() _apply_camera() _init_cursor_nodes() @@ -337,14 +347,6 @@ func _ready() -> void: Chat.set_bubble_visible(true) Chat.set_bubble_host(_chat_bubble_host) - Game.state_updated.connect(_on_state_updated) - Game.game_over.connect(_on_game_over) - Game.session_abandoned.connect(_on_session_abandoned) - Game.opponent_inactive.connect(_on_opponent_inactive) - Game.inactive_warning.connect(_on_inactive_warning) - Game.both_idle_warning.connect(_on_both_idle_warning) - Game.player_eliminated.connect(_on_player_eliminated) - if Game.is_spectating: _is_spectating = true _setup_spectator_ui() @@ -4453,7 +4455,8 @@ func _rebuild_hand(hand: Array) -> void: # Build new IID list. var new_iids : Array[String] = [] for card: Dictionary in hand: - new_iids.append(card.get("instanceId", "") as String) + var raw_iid := card.get("instanceId") + new_iids.append(str(raw_iid) if raw_iid != null else "") if new_iids == _cached_hand_iids: _refresh_hand_selection() return