From 997d0fb6eeeb8e1d28ea78692db680d539a59082 Mon Sep 17 00:00:00 2001 From: mimo Date: Tue, 14 Feb 2017 17:36:58 +0000 Subject: [PATCH] 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. --- binaries/data/mods/public/simulation/ai/petra/tradeManager.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/binaries/data/mods/public/simulation/ai/petra/tradeManager.js b/binaries/data/mods/public/simulation/ai/petra/tradeManager.js index caf8387819..3f6dd9f71a 100644 --- a/binaries/data/mods/public/simulation/ai/petra/tradeManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/tradeManager.js @@ -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");