Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2000:
[Freeciv-Dev] Re: Mines vanish on poles (PR#584)
Home

[Freeciv-Dev] Re: Mines vanish on poles (PR#584)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Christian Knoke <ChrisK@xxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx, bugs@xxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Mines vanish on poles (PR#584)
From: Thue <thue@xxxxxxx>
Date: Wed, 8 Nov 2000 15:00:42 +0100
Reply-to: thue@xxxxxxx

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

Attachment: adjbug.diff
Description: Binary data


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