diff options
author | tron <tron@openttd.org> | 2004-11-08 09:11:55 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-11-08 09:11:55 +0000 |
commit | 37e199cd2b7a7a0a4eb98ccbc3a184abe140eff7 (patch) | |
tree | b0ddc7fc098d0230c262c7371ee69bb52247ad3a | |
parent | 21b1607fb512d112ff3eba0de83d3bbe35d818d6 (diff) | |
download | openttd-37e199cd2b7a7a0a4eb98ccbc3a184abe140eff7.tar.xz |
(svn r526) -Fix: [1035303] bug about lowering tracks built on slopes
While here make sure that the failing tile gets a red error marker
-rw-r--r-- | clear_cmd.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clear_cmd.c b/clear_cmd.c index 2fe056d7d..b6eca369f 100644 --- a/clear_cmd.c +++ b/clear_cmd.c @@ -92,11 +92,15 @@ static int TerraformProc(TerraformerState *ts, uint tile, int mode) if ((_map_type_and_height[tile] >> 4) == MP_RAILWAY) { static const byte _railway_modes[4] = {8, 0x10, 4, 0x20}; static const byte _railway_dangslopes[4] = {0xd, 0xe, 7, 0xb}; + static const byte _railway_dangslopes2[4] = {0x2, 0x1, 0x8, 0x4}; // Nothing could be built at the steep slope - this avoids a bug // when you have a single diagonal track in one corner on a - // basement and then you raise the other corner. - if ((GetTileSlope(tile, NULL)&0xF) == _railway_dangslopes[mode]) { + // basement and then you raise/lower the other corner. + int tileh = GetTileSlope(tile, NULL) & 0xF; + if (tileh == _railway_dangslopes[mode] || + tileh == _railway_dangslopes2[mode]) { + _terraform_err_tile = tile; _error_message = STR_1008_MUST_REMOVE_RAILROAD_TRACK; return -1; } |