Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed out of bounds reference when using BWTA Pathfinding. But also d…

…isabled it as it wasn't effective.
  • Loading branch information...
commit 6fc2e4c3a4d058374cdf4f3991a0bb0cf465a800 1 parent d537a44
Andy Reichert authored
Showing with 11 additions and 9 deletions.
  1. +11 −9 BasicAIModule/source/Agents/ActorAgent.cpp
20 BasicAIModule/source/Agents/ActorAgent.cpp
View
@@ -139,7 +139,7 @@ void ActorAgent::update()
TilePosition target = moveTilePosition;
// Try to use BWTA pathing to get to destination
- bool useBWTAPath = true;
+ bool useBWTAPath = false;
if (useBWTAPath)
{
@@ -150,15 +150,17 @@ void ActorAgent::update()
target = unit.getTilePosition(); // Stay where it is. Will get new order on next cycle.
//Broodwar->sendText("!! Scout Path Empty !!");
}
-
- if (pathVector.size() > 20)
- target = pathVector[20];
- else
- //Broodwar->sendText("Close to Scout Target!");
- //target = pathVector[pathVector.size() - 1]; // Crashes, and I don't know why
- target = moveTilePosition;
+ else
+ {
+ if (pathVector.size() > 20)
+ target = pathVector[20];
+ else
+ //Broodwar->sendText("Close to Scout Target!");
+ target = pathVector[pathVector.size() - 1]; // Crashes, and I don't know why
+ //target = moveTilePosition;
+ }
}
-
+ // Order the unit to move
unit.move(Position(target));
// Record posiion for next iteration
Please sign in to comment.
Something went wrong with that request. Please try again.