diff options
author | tron <tron@openttd.org> | 2006-03-19 12:06:12 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-19 12:06:12 +0000 |
commit | 77e5cf4bc1137805a8e69e6a8ce1370af09dd8d8 (patch) | |
tree | b86bb7662c2be1ce87ebc168346f1677af2a26e4 /waypoint.c | |
parent | ba53ec750a05c8e0e316c8f5838cfad7f9fd13de (diff) | |
download | openttd-77e5cf4bc1137805a8e69e6a8ce1370af09dd8d8.tar.xz |
(svn r3979) Move GetRailFoundation() to rail_map.h and use it and friends to get information about rail tiles
Diffstat (limited to 'waypoint.c')
-rw-r--r-- | waypoint.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/waypoint.c b/waypoint.c index cb51b2ef3..7d2087a35 100644 --- a/waypoint.c +++ b/waypoint.c @@ -182,9 +182,10 @@ int32 CmdBuildTrainWaypoint(int x, int y, uint32 flags, uint32 p1, uint32 p2) /* if custom gfx are used, make sure it is within bounds */ if (p1 >= GetNumCustomStations(STAT_CLASS_WAYP)) return CMD_ERROR; - if (!IsTileType(tile, MP_RAILWAY) || ( - (axis = AXIS_X, _m[tile].m5 != TRACK_BIT_X) && - (axis = AXIS_Y, _m[tile].m5 != TRACK_BIT_Y) + if (!IsTileType(tile, MP_RAILWAY) || + GetRailTileType(tile) != RAIL_TYPE_NORMAL || ( + (axis = AXIS_X, GetTrackBits(tile) != TRACK_BIT_X) && + (axis = AXIS_Y, GetTrackBits(tile) != TRACK_BIT_Y) )) { return_cmd_error(STR_1005_NO_SUITABLE_RAILROAD_TRACK); } |