change ruleset
This commit is contained in:
@@ -353,7 +353,7 @@ func initialize_astar():
|
||||
|
||||
update_astar_costs()
|
||||
|
||||
func find_path(start: Vector2, end: Vector2, floor_index: int = 0) -> Array:
|
||||
func find_path(start: Vector2, end: Vector2, floor_index: int = 0, clear_path_visual: bool = true) -> Array:
|
||||
var astar = astar_by_floor.get(floor_index)
|
||||
if not astar:
|
||||
return []
|
||||
@@ -362,7 +362,9 @@ func find_path(start: Vector2, end: Vector2, floor_index: int = 0) -> Array:
|
||||
var end_point = end.y * columns + end.x
|
||||
path = astar.get_point_path(start_point, end_point)
|
||||
|
||||
clear_path_visualization(floor_index)
|
||||
if clear_path_visual:
|
||||
clear_path_visualization(floor_index)
|
||||
|
||||
set_cell_item(Vector3i(start.x, floor_index, start.y), start_item)
|
||||
set_cell_item(Vector3i(end.x, floor_index, end.y), end_item)
|
||||
for point in path:
|
||||
|
||||
Reference in New Issue
Block a user