src/rail_cmd.cpp
changeset 8083 ad22eade501f
parent 8081 4fddceb00aa6
child 8088 92fca5b09665
equal deleted inserted replaced
8082:63240e1bd6cc 8083:ad22eade501f
    40 #include "train.h"
    40 #include "train.h"
    41 #include "misc/autoptr.hpp"
    41 #include "misc/autoptr.hpp"
    42 #include "autoslope.h"
    42 #include "autoslope.h"
    43 #include "transparency.h"
    43 #include "transparency.h"
    44 #include "water.h"
    44 #include "water.h"
       
    45 #include "tunnelbridge_map.h"
       
    46 
    45 
    47 
    46 const byte _track_sloped_sprites[14] = {
    48 const byte _track_sloped_sprites[14] = {
    47 	14, 15, 22, 13,
    49 	14, 15, 22, 13,
    48 	 0, 21, 17, 12,
    50 	 0, 21, 17, 12,
    49 	23,  0, 18, 20,
    51 	23,  0, 18, 20,
   925 
   927 
   926 		case MP_TUNNELBRIDGE: {
   928 		case MP_TUNNELBRIDGE: {
   927 			TileIndex orig_tile = tile;
   929 			TileIndex orig_tile = tile;
   928 			/* Skip to end of tunnel or bridge */
   930 			/* Skip to end of tunnel or bridge */
   929 			if (IsBridge(tile)) {
   931 			if (IsBridge(tile)) {
   930 				if (GetBridgeTransportType(tile) != TRANSPORT_RAIL) return false;
   932 				if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) return false;
   931 				if (GetBridgeRampDirection(tile) != TrackdirToExitdir(trackdir)) return false;
   933 				if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(trackdir)) return false;
   932 				tile = GetOtherBridgeEnd(tile);
   934 				tile = GetOtherBridgeEnd(tile);
   933 			} else {
   935 			} else {
   934 				if (GetTunnelTransportType(tile) != TRANSPORT_RAIL) return false;
   936 				if (GetTunnelBridgeTransportType(tile) != TRANSPORT_RAIL) return false;
   935 				if (GetTunnelDirection(tile) != TrackdirToExitdir(trackdir)) return false;
   937 				if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(trackdir)) return false;
   936 				tile = GetOtherTunnelEnd(tile);
   938 				tile = GetOtherTunnelEnd(tile);
   937 			}
   939 			}
   938 			signal_ctr += 2 + DistanceMax(orig_tile, tile) * 2;
   940 			signal_ctr += 2 + DistanceMax(orig_tile, tile) * 2;
   939 			return true;
   941 			return true;
   940 		}
   942 		}