1
0
forked from mirrors/0ad

petra: fix a bug preventing petra to build additionnal markets if its second market was destroyed while still a foundation

This was SVN commit r19227.
This commit is contained in:
mimo
2017-02-14 17:36:58 +00:00
parent a443bcfa65
commit 997d0fb6ee
@@ -332,13 +332,13 @@ m.TradeManager.prototype.checkEvents = function(gameState, events)
}
}
// if one market is destroyed, we should look for a better route
// if one market (or market-foundation) is destroyed, we should look for a better route
for (let evt of events.Destroy)
{
if (!evt.entityObj)
continue;
let ent = evt.entityObj;
if (!ent || ent.foundationProgress() !== undefined || !ent.hasClass("Market") || !gameState.isPlayerAlly(ent.owner()))
if (!ent || !ent.hasClass("Market") || !gameState.isPlayerAlly(ent.owner()))
continue;
this.routeProspection = true;
gameState.ai.HQ.restartBuild(gameState, "structures/{civ}_market");