add more synch logging to pathfinder

This commit is contained in:
Mark Vejvoda 2013-05-18 03:11:26 +00:00
parent 3c05195436
commit 24f3a1d6de
1 changed files with 14 additions and 0 deletions

View File

@ -1163,6 +1163,13 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout
const bool tryJPSPathfinder = false;
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
char szBuf[8096]="";
snprintf(szBuf,8096,"Calling doAStarPathSearch nodeLimitReached: %d whileLoopCount: %d unitFactionIndex: %d pathFound: %d finalPos [%s] maxNodeCount: %d frameIndex: %d",nodeLimitReached, whileLoopCount, unitFactionIndex,
pathFound, finalPos.getString().c_str(), maxNodeCount,frameIndex);
unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf);
}
doAStarPathSearch(nodeLimitReached, whileLoopCount, unitFactionIndex,
pathFound, node, finalPos, tryJPSPathfinder,
closedNodes, cameFrom, canAddNode, unit, maxNodeCount,frameIndex);
@ -1179,6 +1186,13 @@ TravelState PathFinder::aStar(Unit *unit, const Vec2i &targetPos, bool inBailout
unit->resetPathfindFailedConsecutiveFrameCount();
}
if(SystemFlags::getSystemSettingType(SystemFlags::debugWorldSynch).enabled == true && frameIndex < 0) {
char szBuf[8096]="";
snprintf(szBuf,8096,"Calling doAStarPathSearch nodeLimitReached: %d whileLoopCount: %d unitFactionIndex: %d pathFound: %d finalPos [%s] maxNodeCount: %d pathFindNodesAbsoluteMax: %d frameIndex: %d",nodeLimitReached, whileLoopCount, unitFactionIndex,
pathFound, finalPos.getString().c_str(), maxNodeCount,pathFindNodesAbsoluteMax,frameIndex);
unit->logSynchData(extractFileFromDirectoryPath(__FILE__).c_str(),__LINE__,szBuf);
}
if(nodeLimitReached == true && maxNodeCount != pathFindNodesAbsoluteMax) {
if(unit->isLastPathfindFailedFrameWithinCurrentFrameTolerance() == true) {
if(frameIndex < 0) {