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
commit4b74fa19230897c9e9b20e6bcba2b16c748cb09f (patch)
tree66c89a776909a6e784becbe687a7906a69356023 /rail_gui.c
parent52e5d9f328de74cc984077d49ea612961e5ce969 (diff)
downloadopenttd-4b74fa19230897c9e9b20e6bcba2b16c748cb09f.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);
}