diff --git a/source/simulation2/components/CCmpPathfinder_Vertex.cpp b/source/simulation2/components/CCmpPathfinder_Vertex.cpp
index 1ab8932..b15e275 100644
a
|
b
|
void CCmpPathfinder::ComputeShortPath(const IObstructionTestFilter& filter,
|
831 | 831 | |
832 | 832 | bool visible = true; |
833 | 833 | u16 i, j; |
834 | | Pathfinding::NearestNavcell(vertexes[curr.id].p.X, vertexes[curr.id].p.Y, i, j, m_Grid->m_W, m_Grid->m_H); |
835 | | if (!IS_PASSABLE(m_Grid->get(i, j), passClass)) |
| 834 | |
| 835 | Pathfinding::NearestNavcell(npos.X, npos.Y, i, j, m_Grid->m_W, m_Grid->m_H); |
| 836 | // we may not go on impassable vertexes, so close it if this vertex is like that. |
| 837 | // lazily computed for performance. |
| 838 | // NB: this is only possible because we do not add the "search area" edges, |
| 839 | // and some obstructions may create vertexes outside of it where terrain edges are not computed. |
| 840 | if (!IS_PASSABLE(m_TerrainOnlyGrid->get(i, j), passClass)) |
836 | 841 | { |
837 | | Pathfinding::NearestNavcell(npos.X, npos.Y, i, j, m_Grid->m_W, m_Grid->m_H); |
838 | | // Do not allow path between two impassable vertexes to prevent cases |
839 | | // where a path along an obstruction will end up in an impassable region |
840 | | if (!IS_PASSABLE(m_Grid->get(i, j), passClass)) |
841 | | visible = false; |
| 842 | vertexes[n].status = Vertex::CLOSED; |
| 843 | continue; |
842 | 844 | } |
843 | 845 | |
844 | 846 | visible = visible && |