equal
deleted
inserted
replaced
9 #include "player.h" |
9 #include "player.h" |
10 #include "tile.h" |
10 #include "tile.h" |
11 #include "viewport.h" |
11 #include "viewport.h" |
12 #include "command.h" |
12 #include "command.h" |
13 #include "tunnel_map.h" |
13 #include "tunnel_map.h" |
|
14 #include "bridge_map.h" |
14 #include "variables.h" |
15 #include "variables.h" |
15 #include "table/sprites.h" |
16 #include "table/sprites.h" |
16 #include "unmovable_map.h" |
17 #include "unmovable_map.h" |
17 |
18 |
18 typedef struct TerraformerHeightMod { |
19 typedef struct TerraformerHeightMod { |
255 |
256 |
256 if (IsPlainRailTile(tile)) { |
257 if (IsPlainRailTile(tile)) { |
257 extern const TrackBits _valid_tileh_slopes[2][15]; |
258 extern const TrackBits _valid_tileh_slopes[2][15]; |
258 if (GetTrackBits(tile) & ~_valid_tileh_slopes[0][r]) return_cmd_error(STR_1008_MUST_REMOVE_RAILROAD_TRACK); |
259 if (GetTrackBits(tile) & ~_valid_tileh_slopes[0][r]) return_cmd_error(STR_1008_MUST_REMOVE_RAILROAD_TRACK); |
259 } else return_cmd_error(STR_5800_OBJECT_IN_THE_WAY); |
260 } else return_cmd_error(STR_5800_OBJECT_IN_THE_WAY); |
|
261 } |
|
262 |
|
263 if (MayHaveBridgeAbove(tile) && IsBridgeAbove(tile)) { |
|
264 byte height = GetBridgeHeight(GetNorthernBridgeEnd(tile), GetBridgeAxis(tile)); |
|
265 |
|
266 height /= TILE_HEIGHT; |
|
267 |
|
268 if (a >= height || b >= height || c >= height || d >= height) return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST); |
260 } |
269 } |
261 |
270 |
262 if (direction == -1 && IsTunnelInWay(tile, min)) return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); |
271 if (direction == -1 && IsTunnelInWay(tile, min)) return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); |
263 |
272 |
264 _terraform_err_tile = 0; |
273 _terraform_err_tile = 0; |
499 DrawGroundSprite(_clear_land_sprites_3[GetClearDensity(ti->tile)] + _tileh_to_sprite[ti->tileh]); |
508 DrawGroundSprite(_clear_land_sprites_3[GetClearDensity(ti->tile)] + _tileh_to_sprite[ti->tileh]); |
500 break; |
509 break; |
501 } |
510 } |
502 |
511 |
503 DrawClearLandFence(ti); |
512 DrawClearLandFence(ti); |
|
513 DrawBridgeMiddle(ti); |
504 } |
514 } |
505 |
515 |
506 static uint GetSlopeZ_Clear(const TileInfo* ti) |
516 static uint GetSlopeZ_Clear(const TileInfo* ti) |
507 { |
517 { |
508 return GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh) + ti->z; |
518 return GetPartialZ(ti->x & 0xF, ti->y & 0xF, ti->tileh) + ti->z; |