summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--texteff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/texteff.c b/texteff.c
index 6f1f90811..bddbb11a6 100644
--- a/texteff.c
+++ b/texteff.c
@@ -324,7 +324,7 @@ void DeleteAnimatedTile(TileIndex tile)
for (ti = _animated_tile_list; ti != endof(_animated_tile_list); ti++) {
if (tile == *ti) {
/* remove the hole */
- memmove(ti, ti + 1, endof(_animated_tile_list) - 1 - ti);
+ memmove(ti, ti + 1, (lastof(_animated_tile_list) - ti) * sizeof(_animated_tile_list[0]));
/* and clear last item */
endof(_animated_tile_list)[-1] = 0;
MarkTileDirtyByTile(tile);