elrail.c
changeset 4158 a8f7265a6fd0
parent 4077 d3022f976946
child 4159 55c50b91e5b8
equal deleted inserted replaced
4157:0c3210247472 4158:a8f7265a6fd0
    87 
    87 
    88 		case MP_TUNNELBRIDGE:
    88 		case MP_TUNNELBRIDGE:
    89 			if (IsTunnel(t)) {
    89 			if (IsTunnel(t)) {
    90 				if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
    90 				if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
    91 				if (override != NULL) *override = 1 << GetTunnelDirection(t);
    91 				if (override != NULL) *override = 1 << GetTunnelDirection(t);
    92 				return DiagDirToAxis(GetTunnelDirection(t)) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y;
    92 				return AxisToTrackBits(DiagDirToAxis(GetTunnelDirection(t)));
    93 			} else {
    93 			} else {
    94 				if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
    94 				if (GetRailType(t) != RAILTYPE_ELECTRIC) return 0;
    95 				if (IsBridgeMiddle(t)) {
    95 				if (IsBridgeMiddle(t)) {
    96 					if (IsTransportUnderBridge(t) &&
    96 					if (IsTransportUnderBridge(t) &&
    97 						GetTransportTypeUnderBridge(t) == TRANSPORT_RAIL) {
    97 						GetTransportTypeUnderBridge(t) == TRANSPORT_RAIL) {
   100 						return 0;
   100 						return 0;
   101 					}
   101 					}
   102 				} else {
   102 				} else {
   103 					if (override != NULL && DistanceMax(t, GetOtherBridgeEnd(t)) > 1) *override = 1 << GetBridgeRampDirection(t);
   103 					if (override != NULL && DistanceMax(t, GetOtherBridgeEnd(t)) > 1) *override = 1 << GetBridgeRampDirection(t);
   104 
   104 
   105 					return DiagDirToAxis(GetBridgeRampDirection(t)) == AXIS_X ? TRACK_BIT_X : TRACK_BIT_Y;
   105 					return AxisToTrackBits(DiagDirToAxis(GetBridgeRampDirection(t)));
   106 				}
   106 				}
   107 			}
   107 			}
   108 
   108 
   109 		case MP_STREET:
   109 		case MP_STREET:
   110 			if (GetRoadTileType(t) != ROAD_TILE_CROSSING) return 0;
   110 			if (GetRoadTileType(t) != ROAD_TILE_CROSSING) return 0;