mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-24 12:06:41 +00:00
- Fix: Service orders did not behave like conditional orders; if a train does not need service it did not completely skip the order, but still go in the direction of the depot [FS#3031] (r16802) - Fix: Houses would not get build on the map edge [FS#3025] (r16795) - Fix: Audio playback rate was fixed at 11025Hz regardless of the rate specified to the audio driver, resulting in incorrect playback speed. It is still preferable to use 11025Hz output rate if possible as OpenTTD's sample rate converter is very low quality (r16784) - Fix: Do not use the same error message for turning around road vehicles and flipping parts of trains in the depot [FS#3019] (r16772)
37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
/* $Id$ */
|
|
|
|
/** @file road_map.cpp Complex road accessors. */
|
|
|
|
#include "stdafx.h"
|
|
#include "station_map.h"
|
|
#include "tunnelbridge_map.h"
|
|
|
|
|
|
RoadBits GetAnyRoadBits(TileIndex tile, RoadType rt, bool straight_tunnel_bridge_entrance)
|
|
{
|
|
if (!HasTileRoadType(tile, rt)) return ROAD_NONE;
|
|
|
|
switch (GetTileType(tile)) {
|
|
case MP_ROAD:
|
|
switch (GetRoadTileType(tile)) {
|
|
default:
|
|
case ROAD_TILE_NORMAL: return GetRoadBits(tile, rt);
|
|
case ROAD_TILE_CROSSING: return GetCrossingRoadBits(tile);
|
|
case ROAD_TILE_DEPOT: return DiagDirToRoadBits(GetRoadDepotDirection(tile));
|
|
}
|
|
|
|
case MP_STATION:
|
|
if (!IsRoadStopTile(tile)) return ROAD_NONE;
|
|
if (IsDriveThroughStopTile(tile)) return (GetRoadStopDir(tile) == DIAGDIR_NE) ? ROAD_X : ROAD_Y;
|
|
return DiagDirToRoadBits(GetRoadStopDir(tile));
|
|
|
|
case MP_TUNNELBRIDGE:
|
|
if (GetTunnelBridgeTransportType(tile) != TRANSPORT_ROAD) return ROAD_NONE;
|
|
return straight_tunnel_bridge_entrance ?
|
|
AxisToRoadBits(DiagDirToAxis(GetTunnelBridgeDirection(tile))) :
|
|
DiagDirToRoadBits(ReverseDiagDir(GetTunnelBridgeDirection(tile)));
|
|
|
|
default: return ROAD_NONE;
|
|
}
|
|
}
|