(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.
authorrubidium
Sat, 30 Dec 2006 00:22:03 +0000
changeset 5427 4a2c1c71bddf
parent 5426 d3d5733c5e3a
child 5428 00fab4aeff78
(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.
texteff.c
--- a/texteff.c	Sat Dec 30 00:06:00 2006 +0000
+++ b/texteff.c	Sat Dec 30 00:22:03 2006 +0000
@@ -324,7 +324,7 @@
 	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);