Skip to content

Commit

Permalink
Add extra security against a possible issue with y-value issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcushutchings committed Jan 3, 2024
1 parent d48ed7f commit 1199a58
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rts/Sim/Path/QTPFS/PathSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ void QTPFS::PathSearch::Initialize(
) {
auto& fwd = directionalSearchData[SearchThreadData::SEARCH_FORWARD];

fwd.srcPoint = sourcePoint; fwd.srcPoint.ClampInBounds();
fwd.tgtPoint = targetPoint; fwd.tgtPoint.ClampInBounds();
fwd.srcPoint = sourcePoint; fwd.srcPoint.ClampInBounds(); fwd.srcPoint.y = 0.f;
fwd.tgtPoint = targetPoint; fwd.tgtPoint.ClampInBounds(); fwd.tgtPoint.y = 0.f;

assert( fwd.srcPoint.x != 0.f || fwd.srcPoint.z != 0.f );

Expand Down Expand Up @@ -560,6 +560,9 @@ bool QTPFS::PathSearch::ExecutePathSearch() {
}
#endif

// LOG("%s: search %x result(%d||%d) nodes searched (%d, %d)", __func__, this->GetID()
// , int(haveFullPath), int(havePartPath), int(fwdNodesSearched), int(bwdNodesSearched));

return (haveFullPath || havePartPath);
}

Expand Down Expand Up @@ -1042,6 +1045,7 @@ void QTPFS::PathSearch::TracePath(IPath* path) {

if ( (nodeId & ONLY_NODE_ID_MASK) == 0 ){
assert(point != ZeroVector);
assert(point.y == 0.f);
nodePointIndex = pointIndex;
path->SetPoint(pointIndex++, point);
// { bool printMoveInfo = (selectedUnitsHandler.selectedUnits.size() == 1)
Expand Down

0 comments on commit 1199a58

Please sign in to comment.