Petra: tunings for 9b79b5b844

This was SVN commit r16128.
This commit is contained in:
mimo
2015-01-08 22:01:38 +00:00
parent 0f21151c4b
commit 006faaeaeb
2 changed files with 4 additions and 4 deletions
@@ -912,7 +912,7 @@ m.BaseManager.prototype.update = function(gameState, queues, events)
for (var ent of this.buildings.values())
m.getBestBase(ent, gameState).assignEntity(ent, gameState);
}
else
else if (gameState.ai.HQ.canBuildUnits)
{
this.assignRolelessUnits(gameState);
this.reassignIdleWorkers(gameState);
@@ -264,8 +264,8 @@ m.HQ.prototype.init = function(gameState, queues, deserializing)
this.canBuildUnits = true;
if (!gameState.getOwnStructures().filter(API3.Filters.byClass("CivCentre")).length)
{
var template = gameState.getTemplate(gameState.applyCiv("structures/{civ}_civil_centre"));
if (!template.available(gameState))
var template = gameState.applyCiv("structures/{civ}_civil_centre");
if (gameState.isDisabledTemplates(template) || !gameState.getTemplate(template).available(gameState))
{
if (this.Config.debug > 1)
API3.warn(" this AI is unable to produce any units");
@@ -2080,7 +2080,7 @@ m.HQ.prototype.update = function(gameState, queues, events)
this.navalManager.update(gameState, queues, events);
if (this.Config.difficulty > 0)
if (this.Config.difficulty > 0 && (this.numActiveBase() > 0 || !this.canBuildUnits))
this.attackManager.update(gameState, queues, events);
this.diplomacyManager.update(gameState, events);