mirror of
https://github.com/glest/glest-source.git
synced 2025-09-03 04:52:34 +02:00
- disabled another cache in pathfinder trying to hunt down xplatform out of synch
This commit is contained in:
@@ -137,30 +137,30 @@ TravelState PathFinder::findPath(Unit *unit, const Vec2i &finalPos, bool *wasStu
|
|||||||
}
|
}
|
||||||
|
|
||||||
TravelState ts = tsImpossible;
|
TravelState ts = tsImpossible;
|
||||||
std::vector<Vec2i> cachedPath = unit->getFaction()->findCachedPath(finalPos, unit);
|
//std::vector<Vec2i> cachedPath = unit->getFaction()->findCachedPath(finalPos, unit);
|
||||||
if(cachedPath.size() > 0) {
|
//if(cachedPath.size() > 0) {
|
||||||
path->clear();
|
// path->clear();
|
||||||
for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
|
// for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
|
||||||
path->add(cachedPath[i]);
|
// path->add(cachedPath[i]);
|
||||||
}
|
// }
|
||||||
ts = tsMoving;
|
// ts = tsMoving;
|
||||||
}
|
//}
|
||||||
else {
|
//else {
|
||||||
//route cache miss
|
//route cache miss
|
||||||
ts = aStar(unit, finalPos, false);
|
ts = aStar(unit, finalPos, false);
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(ts == tsBlocked) {
|
if(ts == tsBlocked) {
|
||||||
//std::vector<Vec2i> cachedPath = unit->getFaction()->findCachedPath(finalPos, unit);
|
//std::vector<Vec2i> cachedPath = unit->getFaction()->findCachedPath(finalPos, unit);
|
||||||
if(cachedPath.size() > 0) {
|
//if(cachedPath.size() > 0) {
|
||||||
path->clear();
|
// path->clear();
|
||||||
|
//
|
||||||
for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
|
// for(int i=0; i < cachedPath.size() && i < pathFindRefresh; ++i) {
|
||||||
path->add(cachedPath[i]);
|
// path->add(cachedPath[i]);
|
||||||
}
|
// }
|
||||||
ts = tsMoving;
|
// ts = tsMoving;
|
||||||
unit->addCurrentTargetPathTakenCell(Vec2i(-1),Vec2i(-1));
|
// unit->addCurrentTargetPathTakenCell(Vec2i(-1),Vec2i(-1));
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
//post actions
|
//post actions
|
||||||
|
Reference in New Issue
Block a user