Fix board click occupant redirect: ignore null occupantId for movement

This commit is contained in:
Shard
2026-03-31 12:46:56 +00:00
parent a1e7bd06b1
commit a655ce8e47
@@ -2697,7 +2697,8 @@ func _handle_board_click(mouse_pos: Vector2) -> void:
# Occupied tile with no direct unit-mesh hit → redirect to the occupant.
if unit_id.is_empty() and coord.x >= 0:
var _t := Game.get_tile(coord.x, coord.y)
var _occ := str(_t.get("occupantId", ""))
var _raw_occ = _t.get("occupantId")
var _occ := _raw_occ if _raw_occ is String else ""
if not _occ.is_empty() and _occ != "null":
unit_id = _occ
# Show tile detail drawer and optionally pan camera.
@@ -2767,7 +2768,8 @@ func _handle_board_click(mouse_pos: Vector2) -> void:
# Occupied tile with no direct unit-mesh hit → redirect to the occupant.
if unit_id.is_empty() and coord.x >= 0:
var _t2 := Game.get_tile(coord.x, coord.y)
var _occ2 := str(_t2.get("occupantId", ""))
var _raw_occ2 = _t2.get("occupantId")
var _occ2 := _raw_occ2 if _raw_occ2 is String else ""
if not _occ2.is_empty() and _occ2 != "null":
unit_id = _occ2
if not unit_id.is_empty():