Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions rts/Sim/Path/QTPFS/PathManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,15 @@ bool QTPFS::PathManager::InitializeSearch(QTPFS::entity searchEntity) {
assert((registry.any_of<IPath, UnsyncedIPath, ExternallyManagedSyncedIPath>(pathEntity)));
IPath* path = GetPath(pathEntity);
assert(path->GetPathType() == pathType);

// Somehow units can get wiped without triggering a delete. This is a catch for that until the
// cause can be found and resolved.
const CSolidObject* owner = path->GetOwner();
if (owner != nullptr) {
if (owner->objectUsable == false)
return false;
}

search->Initialize(&nodeLayer, path->GetSourcePoint(), path->GetGoalPosition(), path->GetOwner());
path->SetHash(search->GetHash());
path->SetVirtualHash(search->GetPartialSearchHash());
Expand Down Expand Up @@ -1122,20 +1131,13 @@ bool QTPFS::PathManager::ExecuteSearch(
int currentThread = ThreadPool::GetThreadNum();

assert(search != nullptr);
assert(search->initialized);

// temp-path might have been removed already via
// DeletePath before we got a chance to process it
if (path == nullptr)
return false;

// Somehow units can get wiped without triggering a delete. This is a catch for that until the
// cause can be found and resolved.
const CSolidObject* owner = path->GetOwner();
if (owner != nullptr) {
if (owner->objectUsable == false)
return false;
}

assert(path->GetID() == search->GetID());

bool forceFullPath = false;
Expand Down