summaryrefslogtreecommitdiff
path: root/texteff.c
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2006-12-30 00:22:03 +0000
committerrubidium <rubidium@openttd.org>2006-12-30 00:22:03 +0000
commit9290966044293584e2e115dfdb2db1e22a9e0c1d (patch)
treeb3614fc7a41b5a64cb131af2882fb7a1f8be5b13 /texteff.c
parent9dca03146bd1e7d9e0e07faa9d7cd4c5f5b06adb (diff)
downloadopenttd-9290966044293584e2e115dfdb2db1e22a9e0c1d.tar.xz
(svn r7631) -Fix (r1): some pointer arithmetic gave the number of entries instead of the number of bytes to move when removing the animated state from a tile. This caused desyncs between Little and Big Endian machines. Thanks to pv2b for helping me in locating the bug and to Darkvater for figuring out that the arithmetic returned the number of entries instead of bytes.
Diffstat (limited to 'texteff.c')
-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);