Skip to content

Commit

Permalink
Rejected paths need to be reqeued.
Browse files Browse the repository at this point in the history
  • Loading branch information
marcushutchings committed Jan 7, 2024
1 parent 5ef6bb4 commit de9202c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rts/Sim/Path/QTPFS/PathManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ void QTPFS::PathManager::ReadyQueuedSearches() {
{
auto pathView = registry.view<PathSearch>();

// Any requests that cannot be processed should be removed. We can't do that with ther r*
// Any requests that cannot be processed should be removed. We can't do that with the r*
// iterators becasue that will break them.
std::for_each(pathView.begin(), pathView.end(), [this](entt::entity entity){
if (!registry.all_of<ProcessPath>(entity))
Expand Down Expand Up @@ -1221,7 +1221,7 @@ unsigned int QTPFS::PathManager::RequeueSearch(

assert( oldPath->GetSourcePoint().x != 0.f || oldPath->GetSourcePoint().z != 0.f );

// LOG("%s: [%d] (%f,%f) -> (%f,%f)", __func__, oldPath->GetPathType()
// LOG("%s: [p%x:s%x] (%f,%f) -> (%f,%f)", __func__, oldPath->GetID(), entt::to_integral(searchEntity)
// , pos.x, pos.z, targetPoint.x, targetPoint.z);

return (oldPath->GetID());
Expand Down
2 changes: 2 additions & 0 deletions rts/Sim/Path/QTPFS/PathSearch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ bool QTPFS::PathSearch::ExecutePathSearch() {
if (haveFullPath) {
if (!isFullSearch) {
if (fwdStepIndex > bwdStepIndex){
haveFullPath = havePartPath = false;
rejectPartialSearch = true;
// LOG("%s: rejecting partial path 1 (search %x)", __func__, this->GetID());
return false;
Expand All @@ -555,6 +556,7 @@ bool QTPFS::PathSearch::ExecutePathSearch() {
} else {
// if the partial path could not connect the reverse path, then we need to reject.
if (fwdPathConnected && !bwdPathConnected) {
haveFullPath = havePartPath = false;
rejectPartialSearch = true;
// LOG("%s: rejecting partial path 2 (search %x)", __func__, this->GetID());
return false;
Expand Down

0 comments on commit de9202c

Please sign in to comment.