From c42160ec10d36dee260ad8a25090442e2cc4c333 Mon Sep 17 00:00:00 2001 From: wraitii Date: Wed, 11 Nov 2015 12:23:11 +0000 Subject: [PATCH] Fix an issue where units could not go around large obstructions when short-pathing as it ran in the search-space "walls", reported by gamebot. Fixes #3593. This is also a very slight optimization. This was SVN commit r17224. --- .../simulation2/components/CCmpPathfinder_Vertex.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/source/simulation2/components/CCmpPathfinder_Vertex.cpp b/source/simulation2/components/CCmpPathfinder_Vertex.cpp index b48351b5ef..bf5f62d7fa 100644 --- a/source/simulation2/components/CCmpPathfinder_Vertex.cpp +++ b/source/simulation2/components/CCmpPathfinder_Vertex.cpp @@ -604,16 +604,8 @@ void CCmpPathfinder::ComputeShortPath(const IObstructionTestFilter& filter, fixed rangeZMin = z0 - range; fixed rangeZMax = z0 + range; - // (The edges are the opposite direction to usual, so it's an inside-out square) - edges.emplace_back(Edge{ CFixedVector2D(rangeXMin-fixed::Epsilon(), rangeZMin-fixed::Epsilon()), - CFixedVector2D(rangeXMin-fixed::Epsilon(), rangeZMax+fixed::Epsilon()) }); - edges.emplace_back(Edge{ CFixedVector2D(rangeXMin-fixed::Epsilon(), rangeZMax+fixed::Epsilon()), - CFixedVector2D(rangeXMax+fixed::Epsilon(), rangeZMax+fixed::Epsilon()) }); - edges.emplace_back(Edge{ CFixedVector2D(rangeXMax+fixed::Epsilon(), rangeZMax+fixed::Epsilon()), - CFixedVector2D(rangeXMax+fixed::Epsilon(), rangeZMin-fixed::Epsilon()) }); - edges.emplace_back(Edge{ CFixedVector2D(rangeXMax+fixed::Epsilon(), rangeZMin-fixed::Epsilon()), - CFixedVector2D(rangeXMin-fixed::Epsilon(), rangeZMin-fixed::Epsilon()) }); - + // we don't actually add the "search space" edges as edges, since we may want to cross the + // in some cases (such as if we need to go around an obstruction that's partly out of the search range) // List of obstruction vertexes (plus start/end points); we'll try to find paths through // the graph defined by these vertexes