mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
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.
This commit is contained in:
parent
2f6f0bd477
commit
c42160ec10
1 changed files with 2 additions and 10 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue