Complete.Org: Mailing Lists: Archives: freeciv-dev: February 2002:
[Freeciv-Dev] Re: [Patch] Boolean cleanup in ai/
Home

[Freeciv-Dev] Re: [Patch] Boolean cleanup in ai/

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Petr Baudis <pasky@xxxxxxxxxxx>
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [Patch] Boolean cleanup in ai/
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Feb 2002 21:42:27 +0100
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Tue, Feb 19, 2002 at 09:38:13PM +0100, Petr Baudis wrote:
> 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?

Ack but low priority.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Using only the operating-system that came with your computer is just
  like only playing the demo-disc that came with your CD-player."


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