Re: [Freeciv-Dev] pollution placement bug (PR#71)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Jeff Mallatt wrote:
> In server/cityturn.c, the check_pollution() routine tries to not place
> on city squares. There's a bug, which could be fixed, but I don't mind
> city squares, as long as I can find them.
> This patch does two things: 1. draws pollution on top of cities, so it can be
> easily found; 2. changes check_pollution() so it can pollute the city square,
> but can't pollute outside the city radius.
[ Just as a note, its better to send patches via email
(to bugs@xxxxxxxxxxxxxxxxxxx), preferably as MIME attachments
or uuencode, rather than using the web bug submission form, since
the form tends to wrap long lines and thus break the diffs.
I should add a note to this effect on the bug submission form. ]
> + /* place pollution somewhere in city radius */
> + if ( (x==-2 && y==-2) || (x==-2 && y==2) ||
> + (x==2 && y==-2) || (x==2 && y==2) )
> + continue;
Um, the above doesn't work :-)
Eg, should add pcity->x,y _after_ checking for the corners.
Also, your patch makes pollution show up on top of units, which
looks very strange. And it doesn't show pollution on cities if
the transparent flags client option is turned off.
I suspect it would be easiest to fix these by putting the
code to show pollution on top of a city inside put_city_pixmap();
could then also make the "city unhappy" tile go over the top
of pollution, which would make sense to me.
(Plus put pollution on non-city tiles in pixmap_put_tile(),
but before putting the unit.)