Merge branch 'master' into jgrpp

# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/commit-checker.yml
#	src/command.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/crashlog.cpp
#	src/economy.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/misc_gui.cpp
#	src/newgrf_config.cpp
#	src/openttd.cpp
#	src/settings_gui.cpp
#	src/ship_cmd.cpp
#	src/table/settings/gui_settings.ini
This commit is contained in:
Jonathan G Rennison
2022-05-15 13:54:13 +01:00
121 changed files with 2287 additions and 1592 deletions

View File

@@ -1342,15 +1342,16 @@ static bool GrowTownWithBridge(const Town *t, const TileIndex tile, const DiagDi
if (!(GetTownRoadBits(TileAddByDiagDir(tile, ReverseDiagDir(bridge_dir))) & DiagDirToRoadBits(bridge_dir))) return false;
/* We are in the right direction */
int bridge_length = 0; // This value stores the length of the possible bridge
uint bridge_length = 0; // This value stores the length of the possible bridge
TileIndex bridge_tile = tile; // Used to store the other waterside
const int delta = TileOffsByDiagDir(bridge_dir);
/* To prevent really small towns from building disproportionately
* long bridges, make the max a function of its population. */
int base_bridge_length = 5;
int max_bridge_length = t->cache.population / 1000 + base_bridge_length;
const uint TOWN_BRIDGE_LENGTH_CAP = 11;
uint base_bridge_length = 5;
uint max_bridge_length = std::min(t->cache.population / 1000 + base_bridge_length, TOWN_BRIDGE_LENGTH_CAP);
if (slope == SLOPE_FLAT) {
/* Bridges starting on flat tiles are only allowed when crossing rivers, rails or one-way roads. */