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 02:07:03 -0700
Reply-to: rt@xxxxxxxxxxxxxx

On Tue, Jul 29, 2003 at 12:52:25AM -0700, Andy Smith wrote:
> 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.

Ignore that, you're right of course.  I am beginning to confuse
myself with the logic now. :)

How's this patch (attached)?

I wanted to match up H_MAP with map_get_known() and H_FOG with
map_get_seen() but map_get_seen() is static to maphand.c so I had to
use map_get_known_and_seen() for the second one.  That works but is
maybe a little confusing.  Should be noted, or map_get_seen() should
be made visible?

Otherwise if it is just as you said above then won't an AI with
H_MAP but _without_ H_FOG wrongly fail map_get_known_and_seen() for
tiles that it knows and is allowed to cheat to see?



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