[Freeciv-Dev] Re: [PATCH] [aiunit.c-1.40] ai_military_findvictim() clean
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dear diary, on Fri, Feb 22, 2002 at 07:11:47PM CET, I got a letter,
where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> > +This function looks at tiles directly neighbouring the unit in order to
> > find
>
> s/tiles directly neighbouring/tiles adjacent to/
Done.
> > +something to kill or explore. It prefers tiles in the following order:
> >
> > -work of Syela - mostly to fix the ZOC/goto strangeness
> > +Returns value of the victim which has been chosen:
> > +
> > +99999 means empty (undefended) city
> > +99998 means hut
>
> > +sane number means value of enemy unit weaker than our unit
>
> Sane is relative: s/sane number/number from (1..99998)/
Ok.
> > +1 means barbarians wanting to pillage
> > +0 means nothing found or error
> > +-2*MORT*TRADE_WEIGHTING means nothing found and punit causing unhappiness
>
> > +If nothing is chosen, (dest_x, dest_y) is set to actual punit's position.
>
> s/If nothing is chosen/If a value <=0 is returned/
> Is <=0 correct here?
Yes.
> > + int units_stack = unit_list_size(&(map_get_tile(punit->x,
> > punit->y)->units));
>
> Either rename to stack_size or create a "bool more_than_one_unit_here = ...".
Yes sir.
> > + best = 0 - 2 * MORT * TRADE_WEIGHTING;
>
> s/0 //
Done.
> > + benefit = (benefit + unit_value(get_role_unit(F_CITIES, 0)))
> > + * punit->hp / unit_type(punit)->hp;
>
> Could be replaced by
> > + benefit += unit_value(get_role_unit(F_CITIES, 0));
> > + benefit = (benefig * punit->hp) / unit_type(punit)->hp;
Ok (didn't reproduce exactly ;).
Improved patch attached.
--
Petr "Pasky" Baudis
* elinks maintainer * IPv6 guy (XS26 co-coordinator)
* IRCnet operator * FreeCiv AI hacker
.
No one can feel as helpless as the owner of a sick goldfish.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/
findvictim-cleanup.patch
Description: Text document
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), (continued)
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [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) [aiunit.c-1.38], Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.39] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264) [aiunit.c-1.38], Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.40] ai_military_findvictim() cleanup (PR#1264),
Petr Baudis <=
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.40] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.42] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.42] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Gregory Berkolaiko, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 2002/02/22
|
|