Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#
Home

[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]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx, Petr Baudis <pasky@xxxxxxxxxxx>
Cc: Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] aiunit.c ai_military_findvictim() cleanup (PR#1264)
From: Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>
Date: Fri, 22 Feb 2002 15:36:10 +0000 (GMT)

 --- Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 
> 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...
> > > 
[...]
> > > 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?

Basically we agree that this unhappiness setting in not used at all.

However boolean value will not be sufficient.  You need at least three:
NOTHING_TO_KILL
SOMETHING_GOOD
SOMETHING_SO_GOOD_EVEN_A_BODYGUARD_CANT_RESIST_IT

Then all of them would be used, fx in

1631       ai_military_findvictim(pplayer, punit, &dest_x, &dest_y);  
1632       if (dest_x == punit->x && dest_y == punit->y) {
1633 /* no one to bash here.  Will try to move onward */

this idiotic if (dest....) would be replaced by a better one
if (ai_mil_fv(...) == NOTHING_TO_KILL)

I would suggest commiting Petr's patch as a cleanup patch asap and then 
making an upgrade patch with fixing typos and making sense of return values.

Best,
G.

__________________________________________________
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


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