test(@projects/@magic-civilization): 🐛 type p0 as PlayerScript so traded_luxuries assignment is static

Through a RefCounted-typed ref, p0.traded_luxuries = <Array[String]> 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) <noreply@anthropic.com>
This commit is contained in:
Natalie 2026-06-24 04:30:16 -04:00
parent 3d32482acc
commit 169e890fce

View file

@ -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"