90 return r; |
90 return r; |
91 |
91 |
92 if ((_map_type_and_height[tile] >> 4) == MP_RAILWAY) { |
92 if ((_map_type_and_height[tile] >> 4) == MP_RAILWAY) { |
93 static const byte _railway_modes[4] = {8, 0x10, 4, 0x20}; |
93 static const byte _railway_modes[4] = {8, 0x10, 4, 0x20}; |
94 static const byte _railway_dangslopes[4] = {0xd, 0xe, 7, 0xb}; |
94 static const byte _railway_dangslopes[4] = {0xd, 0xe, 7, 0xb}; |
|
95 static const byte _railway_dangslopes2[4] = {0x2, 0x1, 0x8, 0x4}; |
95 |
96 |
96 // Nothing could be built at the steep slope - this avoids a bug |
97 // Nothing could be built at the steep slope - this avoids a bug |
97 // when you have a single diagonal track in one corner on a |
98 // when you have a single diagonal track in one corner on a |
98 // basement and then you raise the other corner. |
99 // basement and then you raise/lower the other corner. |
99 if ((GetTileSlope(tile, NULL)&0xF) == _railway_dangslopes[mode]) { |
100 int tileh = GetTileSlope(tile, NULL) & 0xF; |
|
101 if (tileh == _railway_dangslopes[mode] || |
|
102 tileh == _railway_dangslopes2[mode]) { |
|
103 _terraform_err_tile = tile; |
100 _error_message = STR_1008_MUST_REMOVE_RAILROAD_TRACK; |
104 _error_message = STR_1008_MUST_REMOVE_RAILROAD_TRACK; |
101 return -1; |
105 return -1; |
102 } |
106 } |
103 |
107 |
104 // If we have a single diagonal track there, the other side of |
108 // If we have a single diagonal track there, the other side of |