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

Dear diary, on Fri, Feb 22, 2002 at 04:36:10PM CET, I got a letter,
where Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
>  --- 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.

It is! It is! It is! Inside findvictim() it is! See latest patch and comment
about this in it! :)

> 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 like more to still return best and keep those tests... (my old bones
feel we might want to take advantage from this value later).

> 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.

Great idea! But please wait a little more, there is some interesting discussion
here now and some yet unread mails and I want to get that to the patch now
also.

-- 

                                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/


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