src/tunnel_cmd.cpp
branchcustombridgeheads
changeset 5650 aefc131bf5ce
parent 5649 55c8267c933f
--- a/src/tunnel_cmd.cpp	Thu Jan 11 13:41:16 2007 +0000
+++ b/src/tunnel_cmd.cpp	Mon Jan 15 20:14:06 2007 +0000
@@ -107,8 +107,8 @@
 
 	if (flags & DC_EXEC) {
 		if (GB(p1, 9, 1) == TRANSPORT_RAIL) {
-			MakeRailTunnel(start_tile, _current_player, direction,                 GB(p1, 0, 4));
-			MakeRailTunnel(end_tile,   _current_player, ReverseDiagDir(direction), GB(p1, 0, 4));
+			MakeRailTunnel(start_tile, _current_player, direction,                 (RailType)GB(p1, 0, 4));
+			MakeRailTunnel(end_tile,   _current_player, ReverseDiagDir(direction), (RailType)GB(p1, 0, 4));
 			UpdateSignalsOnSegment(start_tile, direction);
 			YapfNotifyTrackLayoutChange(start_tile, AxisToTrack(DiagDirToAxis(direction)));
 		} else {
@@ -399,7 +399,7 @@
 		dir = GetTunnelDirection(tile);
 		vdir = DirToDiagDir(v->direction);
 
-		if (v->u.rail.track != 0x40 && dir == vdir) {
+		if (v->u.rail.track != TRACK_BIT_WORMHOLE && dir == vdir) {
 			if (IsFrontEngine(v) && fc == _tunnel_fractcoord_1[dir]) {
 				if (!PlayVehicleSound(v, VSE_TUNNEL) && v->spritenum < 4) {
 					SndPlayVehicleFx(SND_05_TRAIN_THROUGH_TUNNEL, v);
@@ -408,7 +408,7 @@
 			}
 			if (fc == _tunnel_fractcoord_2[dir]) {
 				v->tile = tile;
-				v->u.rail.track = 0x40;
+				v->u.rail.track = TRACK_BIT_WORMHOLE;
 				v->vehstatus |= VS_HIDDEN;
 				return 4;
 			}
@@ -417,7 +417,7 @@
 		if (dir == ReverseDiagDir(vdir) && fc == _tunnel_fractcoord_3[dir] && z == 0) {
 			/* We're at the tunnel exit ?? */
 			v->tile = tile;
-			v->u.rail.track = _exit_tunnel_track[dir];
+			v->u.rail.track = (TrackBits)_exit_tunnel_track[dir];
 			assert(v->u.rail.track);
 			v->vehstatus &= ~VS_HIDDEN;
 			return 4;
@@ -457,7 +457,7 @@
 }
 
 
-const TileTypeProcs _tile_type_tunnel_procs = {
+extern const TileTypeProcs _tile_type_tunnel_procs = {
 	DrawTile_Tunnel,           /* draw_tile_proc */
 	GetSlopeZ_Tunnel,          /* get_slope_z_proc */
 	ClearTile_Tunnel,          /* clear_tile_proc */