(svn r7617) -Fix (7609): GetTrackBits only works (as intended) for plain rail tiles, so get the trackbits if it is certain it is a plain rail tile. Noticed by Tron.
authorrubidium
Fri, 29 Dec 2006 16:40:22 +0000
changeset 5665 9498578ecbf2
parent 5664 dbbf4f842a00
child 5666 1af12f02bf17
(svn r7617) -Fix (7609): GetTrackBits only works (as intended) for plain rail tiles, so get the trackbits if it is certain it is a plain rail tile. Noticed by Tron.
rail_cmd.c
--- a/rail_cmd.c	Fri Dec 29 13:59:48 2006 +0000
+++ b/rail_cmd.c	Fri Dec 29 16:40:22 2006 +0000
@@ -967,7 +967,6 @@
 {
 	int32 cost;
 	int32 ret;
-	TrackBits tracks = GetTrackBits(tile);
 
 	if (flags & DC_AUTO) {
 		if (!IsTileOwner(tile, _current_player))
@@ -985,6 +984,7 @@
 	switch (GetRailTileType(tile)) {
 		case RAIL_TILE_SIGNALS:
 		case RAIL_TILE_NORMAL: {
+			TrackBits tracks = GetTrackBits(tile);
 			uint i;
 
 			for_each_bit (i, tracks) {