summaryrefslogtreecommitdiff
path: root/rail_gui.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-19 13:48:08 +0000
committertron <tron@openttd.org>2006-03-19 13:48:08 +0000
commita90e46bf03365920f2a13254ec17f1d4f76727f6 (patch)
tree66c89a776909a6e784becbe687a7906a69356023 /rail_gui.c
parent667666f1a3a108b6297527102f173deff56d072d (diff)
downloadopenttd-a90e46bf03365920f2a13254ec17f1d4f76727f6.tar.xz
(svn r3981) More work for the rail accessing functions and enums
Diffstat (limited to 'rail_gui.c')
-rw-r--r--rail_gui.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/rail_gui.c b/rail_gui.c
index d2fcb1920..f641a551e 100644
--- a/rail_gui.c
+++ b/rail_gui.c
@@ -83,10 +83,8 @@ static void PlaceRail_AutoRail(TileIndex tile)
static void PlaceExtraDepotRail(TileIndex tile, uint16 extra)
{
- byte b = _m[tile].m5;
-
- if (GB(b, 6, 2) != RAIL_TYPE_NORMAL >> 6) return;
- if (!(b & (extra >> 8))) return;
+ if (GetRailTileType(tile) != RAIL_TYPE_NORMAL) return;
+ if ((GetTrackBits(tile) & GB(extra, 8, 8)) == 0) return;
DoCommandP(tile, _cur_railtype, extra & 0xFF, NULL, CMD_BUILD_SINGLE_RAIL | CMD_AUTO | CMD_NO_WATER);
}