Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] (PR#4538) [Bug] is_enemy_unit_tile sometimes doesn't work
Home

[Freeciv-Dev] (PR#4538) [Bug] is_enemy_unit_tile sometimes doesn't work

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory.Berkolaiko@xxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#4538) [Bug] is_enemy_unit_tile sometimes doesn't work in client.
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jul 2003 07:31:14 -0700
Reply-to: rt@xxxxxxxxxxxxxx

[glip - Fri Jul 11 18:11:05 2003]:

> If you call, from the client, is_enemy_unit_tile on a tile containing
> enemy unit in a city, the functio will return NULL.  This so far only
> causes problems for path finding but will also cause trouble for any
> future client-side AI.
> 
> Same problem applies to all is_*_unit_tile functions.
> 
> Here we have a choice: 
>  (1) fix all is_*_unit_tile functions, 
> or 
>  (2) fix the functions which use them.
> To do (1), the signature of the functions must be changed to bool (not 
> that it's ever used as a pointer).
> 
> And a problem: the information given by a "occupied" flag over city is
not 
> complete.  Enemy city may contain neutral unit.  And for the fogged city, 
> the occupied flag means nothing.  

is_*_unit_tile should return a boolean, not a pointer.  Or it should be
renamed...

For fogged tiles we shouldn't worry; these will fail when called on
normal tiles anyway.  Other cases must be decided intelligently on a
case-by-case basis.  But even a partial fix will be an improvement.

jason



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