Skip to content

Commit 4578784

Browse files
committed
Show adjacent previews if either side is a passage
1 parent 0424d46 commit 4578784

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

addons/MetroidvaniaSystem/Scripts/RoomInstance.gd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ func _update_neighbor_previews():
7676
for i in 4:
7777
var fwd: Vector2i = MetroidvaniaSystem.MapData.FWD[i]
7878

79+
var show_neightbor: bool
7980
if cell_data.borders[i] > 0:
81+
show_neightbor = true
82+
elif cell_data.borders[i] == 0:
83+
var neicell := MetSys.map_data.get_cell_at(coords + Vector3i(fwd.x, fwd.y, 0))
84+
if neicell:
85+
show_neightbor = neicell.borders[(i + 2) % 4] > 0
86+
87+
if show_neightbor:
8088
var next_coords := coords + Vector3i(fwd.x, fwd.y, 0)
8189
var scene: String = MetSys.map_data.get_assigned_scene_at(next_coords)
8290

0 commit comments

Comments
 (0)