Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
Re: [Freeciv-Dev] pollution placement bug (PR#71)
Home

Re: [Freeciv-Dev] pollution placement bug (PR#71)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jjm@xxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Freeciv-Dev] pollution placement bug (PR#71)
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Fri, 30 Jul 1999 11:38:52 +1000 (EST)

Jeff Mallatt wrote:

> In server/cityturn.c, the check_pollution() routine tries to not place
> pollution
> on city squares.  There's a bug, which could be fixed, but I don't mind
> polluted
> 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 */
>        x=pcity->x+myrand(5)-2;
>        y=pcity->y+myrand(5)-2;
> +      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.)

Regards,
-- David

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