summaryrefslogtreecommitdiff
path: root/src/landscape.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-07-01 14:51:05 +0000
committerrubidium <rubidium@openttd.org>2009-07-01 14:51:05 +0000
commit927c4a0fe8b836fe88ca0636d2249016501dc9c3 (patch)
tree076df478323806636b50630f76dd7415abc0e504 /src/landscape.cpp
parent8db99f57f87776dd86b7b3d12b9150363dd8d688 (diff)
downloadopenttd-927c4a0fe8b836fe88ca0636d2249016501dc9c3.tar.xz
(svn r16709) -Fix [FS#2994]: the list of animated tiles could have duplicates (only for old savegames) and tiles that weren't animated
Diffstat (limited to 'src/landscape.cpp')
-rw-r--r--src/landscape.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/landscape.cpp b/src/landscape.cpp
index 372cf5d50..bf1d4414e 100644
--- a/src/landscape.cpp
+++ b/src/landscape.cpp
@@ -22,6 +22,7 @@
#include "effectvehicle_func.h"
#include "landscape_type.h"
#include "settings_type.h"
+#include "animated_tile_func.h"
#include "table/sprites.h"
@@ -471,6 +472,9 @@ void DrawFoundation(TileInfo *ti, Foundation f)
void DoClearSquare(TileIndex tile)
{
+ /* If the tile can have animation and we clear it, delete it from the animated tile list. */
+ if (_tile_type_procs[GetTileType(tile)]->animate_tile_proc != NULL) DeleteAnimatedTile(tile);
+
MakeClear(tile, CLEAR_GRASS, _generating_world ? 3 : 0);
MarkTileDirtyByTile(tile);
}