[Freeciv-Dev] Re: Mines vanish on poles (PR#584)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Mon, 23 Oct 2000 21:43:28 Christian Knoke wrote:
> Freeciv version 1.11.4 and CVS
> Linux/i386/GTK
>
> I can build mines on the pole (on ice); in the
> round when they are just finished you can use
> the tile, showing 1 prod.shield. But the next
> round they are vanished - oops.
>
> Savegame is on http://www.enter.de/~c.knoke/pole_mines.sav.gz
> Login as Mary Stuart and play with the scottish city of Ayr.
Annoying bug to track down... What happens is that we are calculating the
irrigation value for a non-existant tile (y >= map.ysize)
ptile = map_get_tile(x, y)
save_special = ptile->special;
map_clear_special(x, y, S_MINE);
[calculate]
/* Now restore tile */
ptile->special = save_special;
Now, the problem is that map_get_tile() returns the void_tile, but
map_clear_special() removes the mine from a real tile (with map_adjust_y'ed y
value). bye
bye mine.
I never really liked that option of returning void_tile. It does nothing but
mask bad good as ok, as here where we are trying to calculate a value for a tile
that doesn't exist. If I get the time I will remove it. (note that this patch
does fix this bug, but I have seen many more bugs of this kind in the code,
though
most less severe).
-Thue
adjbug.diff
Description: Binary data
- [Freeciv-Dev] Re: Mines vanish on poles (PR#584),
Thue <=
|
|