Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2003:
[Freeciv-Dev] Re: (PR#4701) autoattack oddities esp. with cruise missile
Home

[Freeciv-Dev] Re: (PR#4701) autoattack oddities esp. with cruise missile

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] Re: (PR#4701) autoattack oddities esp. with cruise missiles
From: "Andy Smith" <andy@xxxxxxxxxxxxxx>
Date: Tue, 29 Jul 2003 00:52:25 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, Jul 29, 2003 at 12:10:43AM -0700, Jason Short wrote:
> I think in this case the check should be
> 
>    if ((ai_handicap(pplayer, H_MAP) || ai_handicap(pplayer, H_FOG))
>        && (!map_get_known_and_seen(x, y, pplayer)
>            || !player_can_see_unit_at_location(pplayer, enemy, x, y))) {
>      continue;
>    }
> 
> in other words, only if the H_MAP (all-tiles-known) and H_FOG 
> (all-tiles-seen) handicaps are unset is the vision check skipped.
> 
> OTOH I always have trouble with the logic of the handicaps.

Yes, unfortunately from checking some other uses of ai_handicap()
(e.g. http://www.freeciv.org/lxr/source/server/unittools.c#L2289) it
seems to me that the logic is actually the opposite here.

Also, some places in the code check if the player is an AI first and
then also check ai_handicap(), but others don't.  ai_handicap()
itself checks first if the player is AI and always returns TRUE if
not.

So, should new uses of ai_handicap() be doing their own checking of
pplayer->ai.control or not?  The majority do not so am I to assume
that those which do are old/redundant?



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