mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
- attempt to further improve pathfinder performance when MANY units are on the map
This commit is contained in:
parent
c47b6c676c
commit
1e104f0496
@ -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(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) {
|
if(cachedPath.size() > 0) {
|
||||||
|
path->clear();
|
||||||
|
for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
|
||||||
|
path->add(cachedPath[i]);
|
||||||
|
}
|
||||||
|
ts = tsMoving;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//route cache miss
|
//route cache miss
|
||||||
|
Loading…
x
Reference in New Issue
Block a user