diff --git a/paths.go b/paths.go index ce16c13..f394de7 100644 --- a/paths.go +++ b/paths.go @@ -348,7 +348,7 @@ func (m *Grid) GetPathFromCells(start, dest *Cell, diagonals, wallsBlockDiagonal left := false leftNeighbor := m.Get(node.Cell.X-1, node.Cell.Y) if leftNeighbor != nil && leftNeighbor.Walkable { - up = true + left = true } right := false @@ -357,7 +357,6 @@ func (m *Grid) GetPathFromCells(start, dest *Cell, diagonals, wallsBlockDiagonal right = true } - if node.Cell.X > 0 && node.Cell.Y > 0 { c := m.Get(node.Cell.X-1, node.Cell.Y-1) n := &Node{c, node, c.Cost + node.Cost + diagonalCost}