Complete.Org: Mailing Lists: Archives: freeciv-dev: September 2001:
[Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming
Home

[Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 2 Sep 2001 00:34:16 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Sat, Sep 01, 2001 at 06:05:45PM -0400, Jason Dorje Short wrote:
> Raimar Falke wrote:
> > 
> 
> > > >>  static void find_city_beach( struct city *pc, struct unit *punit, int
> > > *x, int *y)
> > > >> -  int search_dist = real_map_distance( pc->x, pc->y, punit->x, 
> > > >> punit->y );
> > > >> +  int search_dist = real_map_distance(pc->x, pc->y, punit->x, 
> > > >> punit->y)
> > > - 1;
> > > >> +
> > > >> -  square_iterate(punit->x, punit->y, search_dist - 1, xx, yy) {
> > > >> +  square_iterate(punit->x, punit->y, search_dist, xx, yy) {
> > > >
> > > >Well this is equivalent but why did you changed it?
> > >
> > > Actually I like Gaute's change. It at least makes it clearer what the bug
> > > in this code is. Note this was discussed, and the bug is that you cannot
> > > find_city_beach if you are adjacent to the city with this routine.
> > >
> > > Actually, I take this back. If you are in a city or apply the rivers
> > > patch, the square_iterate can actually succeed. But cities aren't allowed
> > > to be adjacent with most rulesets, and finding a convenient adjacent
> > > river won't be that easy in most cases.
> > 
> > Please look: if you the expression right to "int search_dist =" into
> > the square_iterate call you get in both cases
> > "real_map_distance(...)-1". So what is your point. Any Gautes?
> 
> What Ross is saying is that the original code is buggy and the -1 should
> not be in there at all.

Ok. The changes Gaute had done are still noise IMHO since I didn't see
the bug before and after the changes. I would expect a comment if
Gaute spotted the bug.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "How about the new language C&? No, that's not 'c ampersand', 'c reference', 
  'reference to c' or 'c and'. It's pronounced 'campersand', to confuse the 
  hell out of people who are unfamiliar with it, and it will, of course, 
  have no pointers."
    -- Xazziri in comp.lang.c++ about C#


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