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:
parent
b45c9dcdb1
commit
d56069488f
|
@ -676,13 +676,14 @@ const TechTree *AiInterface::getTechTree(){
|
||||||
|
|
||||||
bool AiInterface::isResourceInRegion(const Vec2i &pos, const ResourceType *rt, Vec2i &resourcePos, int range) const {
|
bool AiInterface::isResourceInRegion(const Vec2i &pos, const ResourceType *rt, Vec2i &resourcePos, int range) const {
|
||||||
const Map *map= world->getMap();
|
const Map *map= world->getMap();
|
||||||
RandomGen random;
|
|
||||||
int xi=1;
|
int xi=1;
|
||||||
int xj=1;
|
int xj=1;
|
||||||
if(random.randRange(0,1)==1){
|
|
||||||
|
if(rand() % 2==1){
|
||||||
xi=-1;
|
xi=-1;
|
||||||
}
|
}
|
||||||
if(random.randRange(0,1)==1){
|
if(rand() % 2==1){
|
||||||
xj=-1;
|
xj=-1;
|
||||||
}
|
}
|
||||||
for(int i = -range; i <= range; ++i) {
|
for(int i = -range; i <= range; ++i) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user