Mercurial > hg > openttd
changeset 8429:82300f180de3 draft
(svn r11999) -Fix: Do entrance-slope-check for every tile of railstations.
author | frosch <frosch@openttd.org> |
---|---|
date | Mon, 28 Jan 2008 14:36:54 +0000 |
parents | f92ccc2f6f17 |
children | 4ab608abd2d9 |
files | src/station_cmd.cpp |
diffstat | 1 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -700,7 +700,7 @@ * @param w width of search area * @param h height of search area * @param flags operation to perform - * @param invalid_dirs prohibited directions + * @param invalid_dirs prohibited directions (set of DiagDirections) * @param station StationID to be queried and returned if available * @param check_clear if clearing tile should be performed (in wich case, cost will be added) * @return the cost in case of success, or an error code if it failed. @@ -735,11 +735,12 @@ int flat_z = z; if (tileh != SLOPE_FLAT) { - /* need to check so the entrance to the station is not pointing at a slope. */ - if ((invalid_dirs & 1 && !(tileh & SLOPE_NE) && (uint)w_cur == w) || - (invalid_dirs & 2 && !(tileh & SLOPE_SE) && h_cur == 1) || - (invalid_dirs & 4 && !(tileh & SLOPE_SW) && w_cur == 1) || - (invalid_dirs & 8 && !(tileh & SLOPE_NW) && (uint)h_cur == h)) { + /* need to check so the entrance to the station is not pointing at a slope. + * This must be valid for all station tiles, as the user can remove single station tiles. */ + if ((HasBit(invalid_dirs, DIAGDIR_NE) && !(tileh & SLOPE_NE)) || + (HasBit(invalid_dirs, DIAGDIR_SE) && !(tileh & SLOPE_SE)) || + (HasBit(invalid_dirs, DIAGDIR_SW) && !(tileh & SLOPE_SW)) || + (HasBit(invalid_dirs, DIAGDIR_NW) && !(tileh & SLOPE_NW))) { return_cmd_error(STR_0007_FLAT_LAND_REQUIRED); } cost.AddCost(_price.terraform);