Complete.Org: Mailing Lists: Archives: freeciv-dev: December 1998:
Re: [Freeciv-Dev] Looking for a unit.
Home

Re: [Freeciv-Dev] Looking for a unit.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Nicolas BRUNEL <brunel@xxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Looking for a unit.
From: Trent Piepho <xyzzy@xxxxxxxxxxxxxxxx>
Date: Tue, 22 Dec 1998 23:25:30 -0800 (PST)

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.



[Prev in Thread] Current Thread [Next in Thread]