From b2be14ca33e71c5b9dba84d237d9448367e98f0a Mon Sep 17 00:00:00 2001 From: Mark Vejvoda Date: Tue, 5 Feb 2013 06:56:59 +0000 Subject: [PATCH] - updated the AI's scouting logic - updated from transifex --- source/glest_game/ai/ai.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/glest_game/ai/ai.cpp b/source/glest_game/ai/ai.cpp index 101a0485..c2d7b4ba 100644 --- a/source/glest_game/ai/ai.cpp +++ b/source/glest_game/ai/ai.cpp @@ -738,15 +738,22 @@ void Ai::sendScoutPatrol(){ std::vector warningEnemyList = aiInterface->getEnemyWarningPositionList(); if(warningEnemyList.empty() == false) { - for(int i = warningEnemyList.size() - 1; i <= 0; --i) { + // Randomly check the enemy warning location list + if(random.randRange(0, 1) == 1) { + //for(int i = warningEnemyList.size() - 1; i <= 0; --i) { + + // randomly pick a location from the location list + int i = random.randRange(0, warningEnemyList.size() - 1); + Vec2i &checkPos = warningEnemyList[i]; pos = checkPos; possibleTargetFound = true; aiInterface->removeEnemyWarningPositionFromList(checkPos); - break; + // break; + //} } } - else if( megaResourceAttack || ultraResourceAttack) { + if(possibleTargetFound == false && (megaResourceAttack || ultraResourceAttack)) { Map *map= aiInterface->getMap(); const TechTree *tt= aiInterface->getTechTree();