Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/defenseManager.js @@ -465,6 +465,16 @@ for (let army of this.armies) army.checkEvents(gameState, events); + for (let evt of events.OwnershipChanged) // capture events + { + if (gameState.isPlayerMutualAlly(evt.from) && evt.to > 0) + { + let ent = gameState.getEntityById(evt.entity); + if (ent && ent.hasClass("CivCentre")) // one of our cc has been captured + gameState.ai.HQ.attackManager.counterAttack(gameState, ent); + } + } + for (let evt of events.Attacked) { let target = gameState.getEntityById(evt.target); Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js @@ -213,14 +213,6 @@ for (let evt of events.OwnershipChanged) // capture events { - if (gameState.isPlayerMutualAlly(evt.from) && evt.to > 0) - { - let ent = gameState.getEntityById(evt.entity); - if (ent && ent.hasClass("CivCentre")) // one of our cc has been captured - this.attackManager.counterAttack(gameState, ent); - continue; - } - if (evt.to !== PlayerID) continue; let ent = gameState.getEntityById(evt.entity);