[Freeciv-Dev] Re: (PR#12559) [Patch] is_ocean() -> can_unit_exist_at_til
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=12559 >
Per I. Mathisen wrote:
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=12559 >
>
> On Mon, 21 Mar 2005, Jason Short wrote:
>
>>Here is an updated version of the patch.
>
>
> if (ptile->city
> || TEST_BIT(target->ai.hunted, pplayer->player_no)
> - || (!is_ocean(ptile->terrain) && is_sailing_unit(punit))
> - || (is_ocean(ptile->terrain) && is_ground_unit(punit))
> + || !can_unit_exist_at_tile(punit, ptile)
> || (!is_sailing_unit(target) && is_sailing_unit(punit))
> || (is_sailing_unit(target) && !is_sailing_unit(punit))
> || !goto_is_sane(punit, target->tile, TRUE)) {
> /* Can't hunt this one. */
> + /* FIXME: this prevents airplanes from hunting sailing units. */
> continue;
>
> This is somewhat mistaken. Hunter code will not handle air units, and it
> should not hunt units in cities.
There's already a city check. As for air units, I guess that means the
FIXME comment is incorrect...but someday this code may handle air units
so it should probably be left in as a note.
-jason
|
|