From 169e890fce398b3e9b435d2c5fa4e85ecfbf8623 Mon Sep 17 00:00:00 2001 From: Natalie Date: Wed, 24 Jun 2026 04:30:16 -0400 Subject: [PATCH] =?UTF-8?q?test(@projects/@magic-civilization):=20?= =?UTF-8?q?=F0=9F=90=9B=20type=20p0=20as=20PlayerScript=20so=20traded=5Flu?= =?UTF-8?q?xuries=20assignment=20is=20static?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Through a RefCounted-typed ref, p0.traded_luxuries = still went via dynamic property-set and tripped "Invalid assignment ... type Array" against the Array[String] property. Typing p0 as PlayerScript makes the set static and type-correct. Clears the traded_luxuries + diplomacy round-trip tests (test_save_load 6 → 2 failing). Co-Authored-By: Claude Opus 4.8 (1M context) --- .../engine/tests/integration/test_save_load_round_trip.gd | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/engine/tests/integration/test_save_load_round_trip.gd b/src/game/engine/tests/integration/test_save_load_round_trip.gd index 7e1d7759..00c64f17 100644 --- a/src/game/engine/tests/integration/test_save_load_round_trip.gd +++ b/src/game/engine/tests/integration/test_save_load_round_trip.gd @@ -25,7 +25,7 @@ func after_each() -> void: func test_traded_luxuries_round_trips() -> void: - var p0: RefCounted = GameState.players[0] + var p0: PlayerScript = GameState.players[0] var lux0: Array[String] = ["silk", "spices", "wine"] p0.traded_luxuries = lux0 @@ -39,7 +39,7 @@ func test_traded_luxuries_round_trips() -> void: func test_traded_luxuries_empty_round_trips() -> void: - var p0: RefCounted = GameState.players[0] + var p0: PlayerScript = GameState.players[0] p0.traded_luxuries = [] SaveManagerScript.save_game(0) @@ -57,7 +57,7 @@ func test_traded_luxuries_empty_round_trips() -> void: func test_clan_id_round_trips() -> void: - var p0: RefCounted = GameState.players[0] + var p0: PlayerScript = GameState.players[0] var p1: RefCounted = GameState.players[1] p0.clan_id = "ironhold" p1.clan_id = "blackhammer" @@ -138,7 +138,7 @@ func test_wonders_built_empty_round_trips() -> void: func test_all_new_fields_round_trip_together() -> void: - var p0: RefCounted = GameState.players[0] + var p0: PlayerScript = GameState.players[0] var lux_m: Array[String] = ["mithril_ore", "deepstone"] p0.traded_luxuries = lux_m p0.clan_id = "goldvein"