diff --git a/sauce/astar.go b/sauce/astar.go index 2654fc8..5e6755c 100644 --- a/sauce/astar.go +++ b/sauce/astar.go @@ -64,7 +64,7 @@ func FindPath(w *World, fromX, fromY int, toX, toY int) ([]Node, bool) { // Iterate over neighbors. for _, neighbor := range neighbors { - tentativeG := current.g + 1 + tentativeG := current.g + 1 + int(w.At(int(neighbor.X), int(neighbor.Y)).Hueristic) distance := int(math.Abs(float64(neighbor.X)-float64(toX)) + math.Abs(float64(neighbor.Y)-float64(toY))) tentativeF := tentativeG + distance