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

[Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() clean

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Raahul Kumar <raahul_da_man@xxxxxxxxx>, Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx>, Mike Kaufman <kaufman@xxxxxxxxxxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] [aiunit.c-1.43] ai_military_findvictim() cleanup (PR#1264)
From: Petr Baudis <pasky@xxxxxxxxxxx>
Date: Fri, 22 Feb 2002 21:21:18 +0100

Dear diary, on Fri, Feb 22, 2002 at 09:19:23PM CET, I got a letter,
where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> On Fri, Feb 22, 2002 at 09:07:11PM +0100, Petr Baudis wrote:
> > Dear diary, on Fri, Feb 22, 2002 at 08:53:54PM CET, I got a letter,
> > where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> > > On Fri, Feb 22, 2002 at 08:37:12PM +0100, Petr Baudis wrote:
> > > > +  int stack_size = unit_list_size(&(map_get_tile(punit->x, 
> > > > punit->y)->units));
> > > 
> > > IMHO this should really be converted to a "bool only_unit_at_tile" or 
> > > similar.
> > 
> > I don't like that. We're making the variables unneccessarily specialized, 
> > which
> > has IMHO minimal aspect to performace, but it's going to give us hell when
> > we'll try to improve this function sometimes in the future.
> 
> Ok.
> 
> > > > +        /* We're only dealing with adjacent victims here. */
> > > > +        int move_cost = 0;
> > > 
> > > > +                    / (attack + vuln) - move_cost * SHIELD_WEIGHTING);
> > > 
> > > Can be removed.
> > 
> > See the TODO near there. I won't remove it now but in the patch unifying 
> > those
> > computations (we'll reuse Greg's one or I'll remake it, but it'll be my
> > top-priority after getting this patch in).
> 
> But there would still be no guaranty that the other patch gets in the
> near future.

That's the exact reason why there's still a move_cost (it will get optimalized
away) and TODO there, so that if I wouldn't for any reason do it, someone other
can easily notice that and take that away when doing something like this.

-- 

                                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]