Added support for diagonal paths

This commit is contained in:
2019-10-24 13:39:49 -05:00
parent 75a03a7155
commit f4c6ad1d35
2 changed files with 41 additions and 1 deletions

View File

@@ -57,7 +57,7 @@ class IMICRTS
@players.find { |player| player.id == id }
end
def find_path(player:, entity:, goal:, travels_along: :ground, allow_diagonal: false, klass: IMICRTS::Pathfinder::BasePathfinder)
def find_path(player:, entity:, goal:, travels_along: :ground, allow_diagonal: true, klass: IMICRTS::Pathfinder::BasePathfinder)
if klass.cached_path(entity, goal, travels_along)
puts "using a cached path!" if true#Setting.enabled?(:debug_mode)
return klass.cached_path(entity, goal, travels_along)