Jul 05, 2004 23:11
Nearby Base Distance
In playing around with a brain lately, I've been using the following if statement to determine if there's a neutral base nearby:
[code:1:a7d99ad98a]
// no friendly base nearby
if (info->base == NULL)
return false;
// friendly but already owned
else if ((info->base != NULL) && (info->base->info != 2))
return false;
// friendly and takeable!
else
return true;
[/code:1:a7d99ad98a]
My problem isn't with the code, it works fine. My problem is that in the brain.h comments it states..
[code:1:a7d99ad98a]ObjectInfo *base; // will be NULL if no friendly base nearby
[/code:1:a7d99ad98a]
So what exactly is classified as "nearby"? Is it what the distance would be for a human to see a friendly/neutral base's resource levels pop up on their screen?
[code:1:a7d99ad98a]
// no friendly base nearby
if (info->base == NULL)
return false;
// friendly but already owned
else if ((info->base != NULL) && (info->base->info != 2))
return false;
// friendly and takeable!
else
return true;
[/code:1:a7d99ad98a]
My problem isn't with the code, it works fine. My problem is that in the brain.h comments it states..
[code:1:a7d99ad98a]ObjectInfo *base; // will be NULL if no friendly base nearby
[/code:1:a7d99ad98a]
So what exactly is classified as "nearby"? Is it what the distance would be for a human to see a friendly/neutral base's resource levels pop up on their screen?
Last edited: Jul 06, 2004 00:24 (edited 1 time)