[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]
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
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Raimar Falke, 2001/09/01
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Gaute B Strokkenes, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Raimar Falke, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Gaute B Strokkenes, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Raimar Falke, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Gaute B Strokkenes, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Raimar Falke, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Trent Piepho, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Raimar Falke, 2001/09/02
- [Freeciv-Dev] Re: [PATCH] Corecleanup_07Part2 has been put in incoming, Trent Piepho, 2001/09/02
|
|