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:
@@ -528,11 +528,14 @@ CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32
|
||||
FALLTHROUGH;
|
||||
|
||||
default:
|
||||
MakeCanal(current_tile, _current_company, Random());
|
||||
if (Company::IsValidID(_current_company)) {
|
||||
/* If we overbuild a water object with a canal, don't update the infrastructure total. */
|
||||
bool is_existing_canal = IsTileType(current_tile, MP_WATER) && IsCanal(current_tile);
|
||||
if (Company::IsValidID(_current_company) && !is_existing_canal) {
|
||||
Company::Get(_current_company)->infrastructure.water++;
|
||||
DirtyCompanyInfrastructureWindows(_current_company);
|
||||
}
|
||||
|
||||
MakeCanal(current_tile, _current_company, Random());
|
||||
break;
|
||||
}
|
||||
MarkTileDirtyByTile(current_tile);
|
||||
|
Reference in New Issue
Block a user