diff options
author | tron <tron@openttd.org> | 2006-03-06 13:29:27 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-06 13:29:27 +0000 |
commit | ce2135341952f61407c268925df5efc2971a4ff0 (patch) | |
tree | 8589f603b3abae0154b8e4f186730f914faa323c | |
parent | 03254940a48ceecb68eee1b64cce4de045e2aab6 (diff) | |
download | openttd-ce2135341952f61407c268925df5efc2971a4ff0.tar.xz |
(svn r3774) Remove some more magic numbers and types
-rw-r--r-- | road_gui.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/road_gui.c b/road_gui.c index a339e528a..73ce819cd 100644 --- a/road_gui.c +++ b/road_gui.c @@ -68,13 +68,12 @@ static void PlaceRoad_Tunnel(TileIndex tile) DoCommandP(tile, 0x200, 0, CcBuildRoadTunnel, CMD_BUILD_TUNNEL | CMD_AUTO | CMD_MSG(STR_5016_CAN_T_BUILD_TUNNEL_HERE)); } -static void BuildRoadOutsideStation(TileIndex tile, int direction) +static void BuildRoadOutsideStation(TileIndex tile, DiagDirection direction) { - static const byte _roadbits_by_dir[4] = {2,1,8,4}; tile += TileOffsByDir(direction); // if there is a roadpiece just outside of the station entrance, build a connecting route if (IsTileType(tile, MP_STREET) && GetRoadType(tile) == ROAD_NORMAL) { - DoCommandP(tile, _roadbits_by_dir[direction], 0, NULL, CMD_BUILD_ROAD); + DoCommandP(tile, DiagDirToRoadBits(ReverseDiagDir(direction)), 0, NULL, CMD_BUILD_ROAD); } } @@ -83,7 +82,7 @@ void CcRoadDepot(bool success, TileIndex tile, uint32 p1, uint32 p2) if (success) { SndPlayTileFx(SND_1F_SPLAT, tile); ResetObjectToPlace(); - BuildRoadOutsideStation(tile, (int)p1); + BuildRoadOutsideStation(tile, p1); } } |