[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 03:46:06PM +0100, Petr Baudis wrote:
> Dear diary, on Fri, Feb 22, 2002 at 03:38:05PM CET, I got a letter,
> where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> > 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.
>
> Please see my another mail :^).
Which one?
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"When C++ is your hammer, everything looks like a thumb."
-- Steven M. Haflich
- [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), 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, 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 <=
- [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
- [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
|
|