Merge branch 'master' into jgrpp

# Conflicts:
#	regression/regression/result.txt
#	src/autoreplace_cmd.cpp
#	src/industry_gui.cpp
#	src/landscape.cpp
#	src/network/network_content.cpp
#	src/newgrf_roadstop.cpp
#	src/pathfinder/yapf/yapf_ship.cpp
#	src/road_gui.cpp
#	src/saveload/ai_sl.cpp
#	src/saveload/saveload.h
#	src/saveload/vehicle_sl.cpp
#	src/station.cpp
#	src/station_gui.cpp
#	src/video/cocoa/cocoa_ogl.h
#	src/video/sdl2_opengl_v.h
#	src/video/video_driver.hpp
#	src/video/win32_v.h
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_type.h
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2024-02-19 18:50:33 +00:00
119 changed files with 4346 additions and 2129 deletions

View File

@@ -292,16 +292,19 @@ static CommandCost RemoveShipDepot(TileIndex tile, DoCommandFlag flags)
if (ret.Failed()) return ret;
}
bool do_clear = (flags & DC_FORCE_CLEAR_TILE) != 0;
if (flags & DC_EXEC) {
delete Depot::GetByTile(tile);
Company *c = Company::GetIfValid(GetTileOwner(tile));
if (c != nullptr) {
c->infrastructure.water -= 2 * LOCK_DEPOT_TILE_FACTOR;
if (do_clear && GetWaterClass(tile) == WATER_CLASS_CANAL) c->infrastructure.water--;
DirtyCompanyInfrastructureWindows(c->index);
}
MakeWaterKeepingClass(tile, GetTileOwner(tile));
if (!do_clear) MakeWaterKeepingClass(tile, GetTileOwner(tile));
MakeWaterKeepingClass(tile2, GetTileOwner(tile2));
}