@@ -502,25 +502,30 @@ CommandCost CmdBuildTunnel(TileIndex sta
end_tile = start_tile;
/** Tile shift coeficient. Will decrease for very long tunnels to avoid exponential growth of price*/
int tiles_coef = 3;
/** Number of tiles from start of tunnel */
int tiles = 0;
/** Number of tiles at which the cost increase coefficient per tile is halved */
int tiles_bump = 25;
for (;;) {
end_tile += delta;
end_tileh = GetTileSlope(end_tile, &end_z);
if (start_z == end_z) break;
if (!_cheats.crossing_tunnels.value && IsTunnelInWayDir(end_tile, start_z, tunnel_in_way_dir)) {
return_cmd_error(STR_5003_ANOTHER_TUNNEL_IN_THE_WAY);
}
tiles++;
if (tiles == 25 || tiles == 50 || tiles == 100 || tiles == 200 || tiles == 400 || tiles == 800) tiles_coef++;
if (tiles == tiles_bump) {
tiles_coef++;
tiles_bump *= 2;
cost.AddCost(_price.build_tunnel);
cost.AddCost(cost.GetCost() >> tiles_coef); // add a multiplier for longer tunnels
/* Add the cost of the entrance */