[Freeciv-Dev] Re: [PATCH] aiunit.c ai_manage_explorer cleanup (PR#1210)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dear diary, on Mon, Feb 11, 2002 at 01:36:49PM CET, I got a letter,
where Gregory Berkolaiko <gberkolaiko@xxxxxxxxxxx> told me, that...
> --- Petr Baudis <pasky@xxxxxxxxxxx> wrote:
> > Dear diary, on Thu, Jan 24, 2002 at 04:25:52AM CET, I got a letter,
> > where Mike Kaufman <mkaufman@xxxxxxxxxxxxxx> told me, that...
> > >
> > > /*
> > > * PART 1: Look for huts
> > > * Non-Barbarian Ground units ONLY.
> > > */
> > >
> > > if (!is_barbarian(pplayer)
> > > && is_ground_unit(punit)) {
> > > /* Maximal acceptable _number_ of moves to the target */
> > > int maxmoves = pplayer->ai.control ? 2 * THRESHOLD : 3;
> > > /* Move _cost_ to the best target (=> lower is better) */
> > > int bestcost = maxmoves * SINGLE_MOVE + 1;
> > > /* Desired destination */
> > > int best_x = -1, best_y = -1;
> > >
> > > /* CPU-expensive but worth it -- Syela */
> > > generate_warmap(map_get_city(x, y), punit);
> > >
> > > >> Syela puts this outside the if...
> >
> > Why I didn't? ;-) Fixed, sir.
>
> Aaabjection!
>
> Imagine a boat which has plenty of black tiles next to it.
> It won't do Part 1 and it will use all it's points in Part 2, so it will
> never use the warmap. So why should a CPU-expensive operation performed
> on it?
Hmh, I've got somewhat polluted with an idea (no clue who could infect me with
it) that warmap is used in the part 2 as well. It looks it isn't, so now I know
why I didn't :-). But...
> I acknowledge that this is slightly more than a mere cleanup but I think
> it should be changed, maybe in a separate patch.
...I agree. Will you make the patch?
> Apart from this I have no complaints resp. the patch and I did read it
> quite carefully.
Fine.
> I think that it should be committed immediately to free both developer's
> and maintainer's time so that they can address real problems, such as MY
> patches ;)
Pffrrt! ;)
Attached patch which applies to the current CVS.
--
Petr "Pasky" Baudis
* UN*X programmer && admin * IPv6 guy (XS26 co-coordinator)
* elinks maintainer * FreeCiv AI hacker
* IRCnet operator
.
I love deadlines.
I love the whooshing sound they make as they fly by.
-- Douglas Adams.
.
Public PGP key && geekcode && homepage: http://pasky.ji.cz/~pasky/
exploring-cleanup.patch
Description: Text document
|
|