Let's see how good Mega-AI plays with real random when trying to find the enemy.

( the server must use this version to see an effect )
This commit is contained in:
titiger 2014-01-27 19:23:31 +01:00
parent b45c9dcdb1
commit d56069488f
1 changed files with 4 additions and 3 deletions

View File

@ -676,13 +676,14 @@ const TechTree *AiInterface::getTechTree(){
bool AiInterface::isResourceInRegion(const Vec2i &pos, const ResourceType *rt, Vec2i &resourcePos, int range) const {
const Map *map= world->getMap();
RandomGen random;
int xi=1;
int xj=1;
if(random.randRange(0,1)==1){
if(rand() % 2==1){
xi=-1;
}
if(random.randRange(0,1)==1){
if(rand() % 2==1){
xj=-1;
}
for(int i = -range; i <= range; ++i) {