[Freeciv-Dev] Re: [Patch] Boolean cleanup in ai/
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Dear diary, on Tue, Feb 19, 2002 at 09:21:23PM CET, I got a letter,
where Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> told me, that...
> > > Index: ai/aiunit.c
> > > ===================================================================
> > > RCS file: /home/freeciv/CVS/freeciv/ai/aiunit.c,v
> > > retrieving revision 1.171
> > > diff -u -r1.171 aiunit.c
> > > --- ai/aiunit.c 2002/02/13 05:55:20 1.171
> > > +++ ai/aiunit.c 2002/02/18 20:26:00
> > > @@ -816,17 +816,17 @@
> > > }
> > > }
> > > if (map_has_special(x1, y1, S_HUT) && best < 99999 &&
> > > - could_unit_move_to_tile(punit, punit->x, punit->y, x1, y1) &&
> > > + could_unit_move_to_tile(punit, punit->x, punit->y, x1, y1) !=
> > > 0 &&
> >
> > Huh. The tristate it returns has no use anyway; so can't we state this
> > function
> > as ZOC-independent and return boolean? Like we did with
> > ai_military_gothere().
>
> The return values is compared against 0 and against 1. So I don't
> think it is possible to remove this.
Oh. I didn't suppose it is in ai/aiunit.c but used in server/ as well.
Shouldn't we move this function to unittools.c or somewhere there?
--
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/
|
|