summaryrefslogtreecommitdiff
path: root/station_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-03-17 10:10:31 +0000
committertron <tron@openttd.org>2006-03-17 10:10:31 +0000
commit89090790c2405a738f5977310549cf94df9c06cb (patch)
tree0fa3ce74d133cc13b1aaf01d162e59d16ce3371e /station_cmd.c
parentd8677f1afad4e706b92689b471d6c7a6c210aa82 (diff)
downloadopenttd-89090790c2405a738f5977310549cf94df9c06cb.tar.xz
(svn r3916) Get/Set the rail type by [GS]etRailType{Crossing,OnBridge,}()
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/station_cmd.c b/station_cmd.c
index edb05f6d3..4eaeb3003 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -1256,12 +1256,10 @@ int32 DoConvertStationRail(TileIndex tile, uint totype, bool exec)
// tile is not a railroad station?
if (_m[tile].m5 >= 8) return CMD_ERROR;
- // tile is already of requested type?
- if (GB(_m[tile].m3, 0, 4) == totype) return CMD_ERROR;
+ if (GetRailType(tile) == totype) return CMD_ERROR;
if (exec) {
- // change type.
- SB(_m[tile].m3, 0, 4, totype);
+ SetRailType(tile, totype);
MarkTileDirtyByTile(tile);
}
@@ -1949,7 +1947,7 @@ static void DrawTile_Station(TileInfo *ti)
uint32 image;
const DrawTileSeqStruct *dtss;
const DrawTileSprites *t = NULL;
- RailType railtype = GB(_m[ti->tile].m3, 0, 4);
+ RailType railtype = GetRailType(ti->tile);
const RailtypeInfo *rti = GetRailTypeInfo(railtype);
SpriteID offset;
uint32 relocation = 0;