(svn r7725) [cbh] - Fix: the vehicle image now gets updated when train enters the bridge wormhole from cbh custombridgeheads
authorKUDr
Mon, 01 Jan 2007 18:27:08 +0000
branchcustombridgeheads
changeset 5625 ff6ea2cb5620
parent 5624 7901de192beb
child 5626 1811beeb472f
(svn r7725) [cbh] - Fix: the vehicle image now gets updated when train enters the bridge wormhole from cbh
bridge_cmd.c
--- a/bridge_cmd.c	Mon Jan 01 18:26:10 2007 +0000
+++ b/bridge_cmd.c	Mon Jan 01 18:27:08 2007 +0000
@@ -1029,6 +1029,9 @@
 		TileIndexDiffC diff = TileIndexDiffCByDiagDir(dir);
 		/* If vehicle didn't reach the edge we can return and try it next time */
 		if (((diff.x != 0 ? x : y) & 0x0F) != (diff.x + diff.y > 0 ? TILE_SIZE - 1 : 0)) return 0;
+		/* We will enter the bridge wormhole. Adjust the other coordinate to the middle of tile
+		* to allow train controller to select proper vehicle image */
+		if (diff.x != 0) v->y_pos = y; else v->x_pos = x;
 
 		/* We're about to enter the bridge body, clear all up/down flags just in case */
 		v->u.rail.track = 0x40;