Merge branch 'master' into jgrpp-beta

# Conflicts:
#	.github/workflows/ci-build.yml
#	src/lang/german.txt
#	src/lang/romanian.txt
#	src/lang/slovak.txt
#	src/lang/turkish.txt
#	src/network/core/address.cpp
#	src/network/core/tcp.h
#	src/network/core/udp.cpp
#	src/network/network.cpp
#	src/network/network_client.cpp
#	src/network/network_server.cpp
#	src/network/network_server.h
#	src/network/network_udp.cpp
#	src/openttd.cpp
#	src/saveload/newgrf_sl.cpp
#	src/tree_cmd.cpp
#	src/video/video_driver.hpp
#	src/window.cpp
#	src/window_gui.h
This commit is contained in:
Jonathan G Rennison
2021-09-22 21:49:32 +01:00
76 changed files with 1226 additions and 617 deletions

View File

@@ -442,7 +442,7 @@ void Station::RecomputeCatchment(bool no_clear_nearby_lists)
if (!_settings_game.station.serve_neutral_industries && this->industry != nullptr) {
/* Station is associated with an industry, so we only need to deliver to that industry. */
this->catchment_tiles.Initialize(this->industry->location);
TILE_AREA_LOOP(tile, this->industry->location) {
for (TileIndex tile : this->industry->location) {
if (IsTileType(tile, MP_INDUSTRY) && GetIndustryIndex(tile) == this->industry->index) {
this->catchment_tiles.SetTile(tile);
}
@@ -458,7 +458,7 @@ void Station::RecomputeCatchment(bool no_clear_nearby_lists)
/* Loop finding all station tiles */
TileArea ta(TileXY(this->rect.left, this->rect.top), TileXY(this->rect.right, this->rect.bottom));
this->station_tiles = 0;
TILE_AREA_LOOP(tile, ta) {
for (TileIndex tile : ta) {
if (!IsTileType(tile, MP_STATION) || GetStationIndex(tile) != this->index) continue;
this->station_tiles++;
}
@@ -470,7 +470,7 @@ void Station::RecomputeCatchment(bool no_clear_nearby_lists)
/* Loop finding all station tiles */
TileArea ta(TileXY(this->rect.left, this->rect.top), TileXY(this->rect.right, this->rect.bottom));
this->station_tiles = 0;
TILE_AREA_LOOP(tile, ta) {
for (TileIndex tile : ta) {
if (!IsTileType(tile, MP_STATION) || GetStationIndex(tile) != this->index) continue;
this->station_tiles++;
@@ -480,7 +480,7 @@ void Station::RecomputeCatchment(bool no_clear_nearby_lists)
/* This tile sub-loop doesn't need to test any tiles, they are simply added to the catchment set. */
TileArea ta2 = TileArea(tile, 1, 1).Expand(r);
TILE_AREA_LOOP(tile2, ta2) this->catchment_tiles.SetTile(tile2);
for (TileIndex tile2 : ta2) this->catchment_tiles.SetTile(tile2);
}
/* Search catchment tiles for towns and industries */
@@ -606,7 +606,7 @@ CommandCost StationRect::BeforeAddRect(TileIndex tile, int w, int h, StationRect
/* static */ bool StationRect::ScanForStationTiles(StationID st_id, int left_a, int top_a, int right_a, int bottom_a)
{
TileArea ta(TileXY(left_a, top_a), TileXY(right_a, bottom_a));
TILE_AREA_LOOP(tile, ta) {
for (TileIndex tile : ta) {
if (IsTileType(tile, MP_STATION) && GetStationIndex(tile) == st_id) return true;
}