Added another check for whether a valid path is set in attackMoveToLocation

This was SVN commit r10764.
This commit is contained in:
Jonathan Waller 2011-12-18 13:15:15 +00:00
parent 574c4135a3
commit 40c1c0010f

View File

@ -491,7 +491,7 @@ MilitaryAttackManager.prototype.buildDefences = function(gameState, queues){
if (numFortresses + queues.defenceBuilding.totalLength() < gameState.getBuildLimits()["Fortress"]) {
if (gameState.countEntitiesWithType(gameState.applyCiv("units/{civ}_support_female_citizen")) > gameState.ai.modules[0].targetNumWorkers * 0.5){
if (gameState.getTimeElapsed() > 200 * 1000 * numFortresses){
if (gameState.getTimeElapsed() > 350 * 1000 * numFortresses){
if (gameState.ai.pathsToMe.length > 0){
var position = gameState.ai.pathsToMe.shift();
// TODO: pick a fort randomly from the list.