NEO-97: fix duplicate npc_row parse error in runtime client

GDScript cannot define instance and static npc_row with the same name;
helpers and tests now call npc_row_in_snapshot for static lookup.
pull/136/head
VinPropane 2026-05-29 21:09:25 -04:00
parent fd0b6d3db8
commit 55bb8d987a
3 changed files with 2 additions and 6 deletions

View File

@ -38,7 +38,7 @@ static func resolve_hud_npc_rows(
var lock_id := locked_target_id_from_state(last_target_state)
var locked_row: Dictionary = {}
if is_known_npc_id(lock_id):
locked_row = NpcRuntimeClient.npc_row(lock_id, npc_runtime_snapshot)
locked_row = NpcRuntimeClient.npc_row_in_snapshot(lock_id, npc_runtime_snapshot)
var incoming_row: Dictionary = {}
var aggro_row: Dictionary = incoming_aggro_row(dev_player_id, npc_runtime_snapshot)
if not aggro_row.is_empty():

View File

@ -60,10 +60,6 @@ func npc_row(instance_id: String, snapshot: Dictionary = {}) -> Dictionary:
return npc_row_in_snapshot(instance_id, source)
static func npc_row(instance_id: String, snapshot: Dictionary = {}) -> Dictionary:
return npc_row_in_snapshot(instance_id, snapshot)
static func npc_row_in_snapshot(instance_id: String, snapshot: Dictionary) -> Dictionary:
var source: Dictionary = snapshot
if source.is_empty():

View File

@ -83,7 +83,7 @@ func test_npc_row_returns_elite_telegraph_fields() -> void:
# Arrange
var parsed: Variant = NpcRuntimeClient.parse_runtime_json(_runtime_snapshot_json())
# Act
var row: Dictionary = NpcRuntimeClient.npc_row(
var row: Dictionary = NpcRuntimeClient.npc_row_in_snapshot(
"prototype_npc_elite", parsed as Dictionary
)
# Assert