- attempt to further improve pathfinder performance when MANY units are on the map

This commit is contained in:
Mark Vejvoda 2010-10-26 06:53:04 +00:00
parent c47b6c676c
commit 1e104f0496
1 changed files with 5 additions and 1 deletions

View File

@ -143,7 +143,11 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
if(chrono.getMillis() > 1) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld, ts = %d, unit = %s [size = %d]\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis(),ts, unit->getFullName().c_str(),unit->getType()->getSize());
if(cachedPath.size() > 0) {
path->clear();
for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
path->add(cachedPath[i]);
}
ts = tsMoving;
}
else {
//route cache miss