- disabled another cache in pathfinder trying to hunt down xplatform out of synch

This commit is contained in:
Mark Vejvoda 2010-11-28 02:36:06 +00:00
parent 664b2b1b7d
commit edbc14a176
1 changed files with 19 additions and 19 deletions

View File

@ -137,30 +137,30 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
}
TravelState ts = tsImpossible;
std::vector<Vec2i> cachedPath = unit->getFaction()->findCachedPath(finalPos, unit);
if(cachedPath.size() > 0) {
path->clear();
for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
path->add(cachedPath[i]);
}
ts = tsMoving;
}
else {
//std::vector<Vec2i> cachedPath = unit->getFaction()->findCachedPath(finalPos, unit);
//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
ts = aStar(unit, finalPos, false);
}
//}
if(ts == tsBlocked) {
//std::vector<Vec2i> cachedPath = unit->getFaction()->findCachedPath(finalPos, unit);
if(cachedPath.size() > 0) {
path->clear();
for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
path->add(cachedPath[i]);
}
ts = tsMoving;
unit->addCurrentTargetPathTakenCell(Vec2i(-1),Vec2i(-1));
}
//if(cachedPath.size() > 0) {
// path->clear();
//
// for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
// path->add(cachedPath[i]);
// }
// ts = tsMoving;
// unit->addCurrentTargetPathTakenCell(Vec2i(-1),Vec2i(-1));
//}
}
//post actions