diff --git a/client/tests/visual_capture.gd b/client/tests/visual_capture.gd index 64665a89f..92acec8b3 100644 --- a/client/tests/visual_capture.gd +++ b/client/tests/visual_capture.gd @@ -184,7 +184,12 @@ func _run_scenario(_main_node: Node) -> void: rf.close() # Decode through Protocol.decode_snapshot() — same as live IPC receive path. # This exercises: msgpack decode → entity decode → tile_kind→type mapping → etc. - var replay_data: Variant = Protocol.decode_snapshot(replay_bytes) + # class_name `Protocol` isn't resolvable in -s mode (see header note); + # instantiate the script and call the static decoder on the instance, + # then free it — the decoded Dictionary is independent of the node. + var protocol_node: Node = load("res://scripts/protocol/protocol.gd").new() + var replay_data: Variant = protocol_node.decode_snapshot(replay_bytes) + protocol_node.free() if replay_data == null or not replay_data is Dictionary: push_error("visual_capture: Protocol.decode_snapshot failed for %s" % abs_path) quit(1)