[Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
--- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, Feb 20, 2002 at 04:09:42PM +0100, Petr Baudis wrote:
> > Typo fixed in attached patch.
>
> >
> /*************************************************************************
> > -This looks at tiles neighbouring the unit to find something to kill or
> > -explore. It prefers tiles in the following order:
> > +This function looks at tiles directly neighbouring the unit in order to
> find
> > +something to kill or explore. It prefers tiles in the following order:
> > +
> > 1. Undefended cities
> > 2. Huts
> > 3. Enemy units weaker than the unit
> > 4. Land barbarians also like unfrastructure tiles (for later pillage)
> > -If none of the following is there, nothing is chosen.
> >
> > -work of Syela - mostly to fix the ZOC/goto strangeness
>
> > +If none of the following is there, nothing is chosen.
>
> How can the caller distinguish this? What does the function return?
>
> > - if (get_transporter_capacity(punit)) {
> > - unit_list_iterate(map_get_tile(x, y)->units, aunit)
> > - if (!is_sailing_unit(aunit)) return(0);
> > - unit_list_iterate_end;
> > - } /* ferryboats do not attack. no. -- Syela */
> > +
>
> > + /* Ferryboats with passengers do not attack. -- Syela */
> > + if (punit->ai.passenger > 0) {
> > + return 0;
> > + }
>
> Are you sure that these are equivalent?
>
> > + benefit = (benefit + 40) * punit->hp / unit_type(punit)->hp;
>
> What is that 40?
I guess it should be something like CITY_CAPTURE_BONUS
> > + SET_BEST(99999);
> ...
> > + if (map_has_special(x1, y1, S_HUT) && best < 99999
> > + && could_unit_move_to_tile(punit, punit->x, punit->y, x1, y1)
> != 0
> > + && !is_barbarian(unit_owner(punit))
> > + && punit->ai.ai_role != AIUNIT_ESCORT
> > + && punit->ai.charge == 0 /* Above line doesn't seem to work. :(
> */
> > + && punit->ai.ai_role != AIUNIT_DEFEND_HOME) {
> > + SET_BEST(99998);
> > + }
>
> These 9999* are ugly.
well, at least it's functional and clear
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), (continued)
- Message not available
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/21
- [Freeciv-Dev] [POOL] Variables descriptions, Petr Baudis, 2002/02/21
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Mike Kaufman, 2002/02/21
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Reinier Post, 2002/02/21
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Raahul Kumar, 2002/02/22
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Daniel L Speyer, 2002/02/22
- [Freeciv-Dev] [POLL] Variables descriptions: Votes on Style, Raahul Kumar, 2002/02/22
- [Freeciv-Dev] Re: [POLL] Variables descriptions, Raimar Falke, 2002/02/22
- [Freeciv-Dev] Freeciv Combat System, Raahul Kumar, 2002/02/21
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264),
Gregory Berkolaiko <=
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Mike Kaufman, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Mike Kaufman, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/20
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/21
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/21
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
|
|