equal
deleted
inserted
replaced
299 if (direction == -1 && IsTunnelInWay(tile, z_min * TILE_HEIGHT)) { |
299 if (direction == -1 && IsTunnelInWay(tile, z_min * TILE_HEIGHT)) { |
300 _terraform_err_tile = tile; // highlight the tile above the tunnel |
300 _terraform_err_tile = tile; // highlight the tile above the tunnel |
301 return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); |
301 return_cmd_error(STR_1002_EXCAVATION_WOULD_DAMAGE); |
302 } |
302 } |
303 /* Check tiletype-specific things, and add extra-cost */ |
303 /* Check tiletype-specific things, and add extra-cost */ |
|
304 const bool curr_gen = _generating_world; |
|
305 if (_game_mode == GM_EDITOR) _generating_world = true; // used to create green terraformed land |
304 CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, tileh); |
306 CommandCost cost = _tile_type_procs[GetTileType(tile)]->terraform_tile_proc(tile, flags | DC_AUTO, z_min * TILE_HEIGHT, tileh); |
|
307 _generating_world = curr_gen; |
305 if (CmdFailed(cost)) { |
308 if (CmdFailed(cost)) { |
306 _terraform_err_tile = tile; |
309 _terraform_err_tile = tile; |
307 return cost; |
310 return cost; |
308 } |
311 } |
309 total_cost.AddCost(cost); |
312 total_cost.AddCost(cost); |