[Freeciv-Dev] Re: [PATCH] Re: Short stupid question (PR#569)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Erik Sigra <freeciv@xxxxxxx> writes:
> Gaute B Strokkenes wrote:
> >
> > Erik Sigra <freeciv@xxxxxxx> writes:
> >
> > > In server/mapgen.c:
> >
> > > Is the use of "*hmap(x, y)" equivalent to the use of "full_map(x, y)"?
> >
> > That's not at all a stupid question. Answer: Yes (bet you're really
> > surprised now, eh? 8-) except that full_map() doesn't check if it
> > should normalise the x-coordinate, which I think is probably a bug
> > since there are lots of calls along the lines of full_map(x-1, y)
> > (well, not directly, but indirectly through e.g. make_dessert() etc.)
> >
> > Here's a patch to clean up the mess:
>
> Thanks. I read it and it looks cleaner with your patch. I was going to
> compile it as well but there was an unrelated error in the way (see my
> previous post) that stopped me. I see no reason not to commit it if it
> works.
>
> #define hmap(x,y) (height_map[(y) * map.xsize + map_adjust_x(x)])
> ^ ^
> Are thoose parentheses really neccessary?
Don't know. I can't think of an operator with a higher priority than
[] that would case trouble, but I didn't bother to look it up in a
table. They certainly don't hurt.
--
Big Gaute (not to be confused with LG)
Are you mentally here at Pizza Hut??
|
|