refactor(ai): ♻️ Update flying unit pathfinding to optimize movement calculations and collision handling
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
9d1989dcb5
commit
3f06902302
1 changed files with 3 additions and 3 deletions
|
|
@ -151,9 +151,9 @@ func _move_toward(
|
|||
target: Vector2i,
|
||||
game_map: RefCounted,
|
||||
) -> void:
|
||||
var pathfinder: RefCounted = PathfinderScript.new(game_map)
|
||||
var path: Array[Vector2i] = pathfinder.find_path(
|
||||
unit.position, target, unit.movement_remaining, unit.is_flying()
|
||||
var unit_type: String = "flying" if unit.is_flying() else "land"
|
||||
var path: Array[Vector2i] = PathfinderScript.find_path(
|
||||
game_map, unit.position, target, unit.movement_remaining, unit_type
|
||||
)
|
||||
|
||||
if path.size() < 2:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue