Skip to content

Commit

Permalink
indexing fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
senloris committed Feb 24, 2024
1 parent 5a5a136 commit e65d93a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/environment.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function Environment:dijkstra(source, targets)
local alt = distance[tostring(current)] + self:getCost(data.type)
if not distance[tostring(data.position)] then
distance[tostring(data.position)] = math.huge
queue:insert(data.position, math.huge + self:heuristic(data.position, targets[1])) -- heuristic from the first target
queue:insert(data.position, math.huge + self:heuristic(data.position, targets)) -- heuristic from the first target
end
if alt < distance[tostring(data.position)] then
distance[tostring(data.position)] = alt
Expand Down

0 comments on commit e65d93a

Please sign in to comment.