[Freeciv-Dev] Re: PATCH: rand_pos function andusage(PR#1017)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Raimar Falke wrote:
>
> On Sun, Oct 28, 2001 at 06:50:46PM -0800, jdorje@xxxxxxxxxxxxxxxxxxxxx wrote:
> > "Ross W. Wetmore" wrote:
> > >
> > > At 01:19 AM 01/10/24 -0400, Jason Dorje Short wrote:
> > > >"Ross W. Wetmore" wrote:
> > In the meantime, can we agree on this patch? It replaces all of the
> > innocuous random position selection with rand_pos, getting rid of most
> > of the "bad" code (including everything not in mapgen). It does not use
> > regular_map_pos_is_normal (which I'd be happy to add back in if
> > desired).
> >
> > I hope we can bring an end to these simple rand_pos changes, leaving the
> > harder ones for later.
>
> I will accept it if you take out the two cases where you use the extra
> do-while loop.
- x = myrand(map.xsize);
- y = 1 + myrand(map.ysize-2); /* No uprising on North or South Pole
*/
+ /* No uprising on North or South Pole */
+ do {
+ rand_pos(&x, &y);
+ } while (y == 0 || y == map.ysize-1);
Can't we leave this one? The chances of the loop repeating are very
small.
I don't care so much about the mapgen loop, but the above loop for
barbarian generation would then be the only non-mapgen code to use the
old construct. I'd like to avoid that if at all possible.
If you insist, I'll remove it - it'll then become more important to get
the alternate rand_pos form into CVS earlier, which Ross probably won't
like :-).
jason
|
|