Re: [Freeciv-Dev] Looking for a unit.
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Wed, 23 Dec 1998, Nicolas BRUNEL wrote:
> Hello,
>
> in my diplomat patch, I want ai settlers to check if a diplomat is
> within range before building a town. Is there another way that going
> through the list of all ennemy units ?
Each tile has a list of units in it, you can use that to check for units in
range. Just scan every tile in range for enemy units. Enemy and friendly
units aren't allowed to be on the same same tile, so you only have to look at
the first unit in the list.
|
|