fix(client): POI category key mismatch — use poi_category from wire format
protocol.gd decoded server's poi_category as "category", minimap.gd read "category" — both now use "poi_category" matching the wire format. Protocol falls back to "category" for older server snapshots. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -207,7 +207,7 @@ static func decode_snapshot(bytes: PackedByteArray) -> Variant:
|
|||||||
})
|
})
|
||||||
|
|
||||||
# v14: poi_list (#151) — discovered POIs for minimap rendering.
|
# v14: poi_list (#151) — discovered POIs for minimap rendering.
|
||||||
# Each entry: {poi_id, name, x, y, z, category}. Positions in sim tile coords.
|
# Each entry: {poi_id, name, x, y, z, poi_category}. Positions in sim tile coords.
|
||||||
var poi_list: Array = []
|
var poi_list: Array = []
|
||||||
var raw_pois: Variant = raw.get("poi_list")
|
var raw_pois: Variant = raw.get("poi_list")
|
||||||
if raw_pois is Array:
|
if raw_pois is Array:
|
||||||
@@ -219,7 +219,7 @@ static func decode_snapshot(bytes: PackedByteArray) -> Variant:
|
|||||||
"x": int(raw_poi["x"]),
|
"x": int(raw_poi["x"]),
|
||||||
"y": int(raw_poi["y"]),
|
"y": int(raw_poi["y"]),
|
||||||
"z": int(raw_poi.get("z", 0)),
|
"z": int(raw_poi.get("z", 0)),
|
||||||
"category": str(raw_poi.get("category", "Location")),
|
"poi_category": str(raw_poi.get("poi_category", raw_poi.get("category", "Location"))),
|
||||||
})
|
})
|
||||||
|
|
||||||
# v14: examine_result (#174, #242) — character-filtered observation text.
|
# v14: examine_result (#174, #242) — character-filtered observation text.
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ func _draw() -> void:
|
|||||||
var dx: float = float(poi.x) - px
|
var dx: float = float(poi.x) - px
|
||||||
var dy: float = float(poi.y) - py
|
var dy: float = float(poi.y) - py
|
||||||
var dist: float = sqrt(dx * dx + dy * dy)
|
var dist: float = sqrt(dx * dx + dy * dy)
|
||||||
var category: String = poi.get("category", "")
|
var category: String = poi.get("poi_category", "")
|
||||||
var color: Color = _category_color(category)
|
var color: Color = _category_color(category)
|
||||||
|
|
||||||
if dist < 0.01:
|
if dist < 0.01:
|
||||||
|
|||||||
Reference in New Issue
Block a user