[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]
On Fri, Feb 22, 2002 at 02:59:29AM -0800, Raahul Kumar wrote:
>
> > +If none of the following is there, nothing is chosen and dest_x, dest_y is
> > set
> > +to actual punit's position.
> > +
> > +Returns value of the victim which has been chosen:
> > +
> > +99999 means empty city
> > +99998 means hut
> > +sane number means ordinar value of the victim
> > +1 means barbarians wanting to pillage
> > +0 means nothing found or error
> > +- 2 * MORT * TRADE_WEIGHTING means nothing found and punit causing
> > unhappiness
And now lets look at the usage of the return values of
ai_military_findvictim:
./ai/aiunit.c:1289: ai_military_findvictim(pplayer, punit, &dest_x,
&dest_y);
./ai/aiunit.c:1631: ai_military_findvictim(pplayer, punit, &dest_x,
&dest_y);
Two times discarded.
./ai/aiunit.c:868: i = ai_military_findvictim(pplayer, punit, &x, &y);
i = ai_military_findvictim(pplayer, punit, &x, &y);
freelog(LOG_DEBUG,
"Stationary escort @(%d,%d) received %d best @(%d,%d)",
punit->x, punit->y, i, x, y);
if (i >= 40 * SHIELD_WEIGHTING)
handle_unit_move_request(punit, x, y, FALSE, FALSE);
/* otherwise don't bother, but free cities are free cities and must be snarfed.
-- Syela */
[ SHIELD_WEIGHTING is currently 17 ]
So it looks to me that a boolean value would be enough. At least this
"- 2 * MORT * TRADE_WEIGHTING" thing can be removed.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"Of course, someone who knows more about this will correct me if I'm
wrong, and someone who knows less will correct me if I'm right."
-- David Palmer (palmer@xxxxxxxxxxxxxxxxxx)
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), (continued)
- [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
- [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264), Mike Kaufman, 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 ai_military_findvictim() cleanup (PR#1264) [aiunit.c-1.38], Gregory Berkolaiko, 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 ai_military_findvictim() cleanup (PR#1264),
Raimar Falke <=
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 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), Raimar Falke, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Petr Baudis, 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), Petr Baudis, 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), Petr Baudis, 2002/02/22
- [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264), Raimar Falke, 2002/02/22
|
|