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]
Cc: jdorje@xxxxxxxxxxxxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming
From: Jason Dorje Short <jshort@xxxxxxxxxxxxx>
Date: Sat, 01 Sep 2001 18:05:45 -0400
Reply-to: jdorje@xxxxxxxxxxxxxxxxxxxxx

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.

jason


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