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:
@@ -150,7 +150,7 @@ Industry::~Industry()
|
||||
|
||||
const bool has_neutral_station = this->neutral_station != nullptr;
|
||||
|
||||
TILE_AREA_LOOP(tile_cur, this->location) {
|
||||
for (TileIndex tile_cur : this->location) {
|
||||
if (IsTileType(tile_cur, MP_INDUSTRY)) {
|
||||
if (GetIndustryIndex(tile_cur) == this->index) {
|
||||
DeleteNewGRFInspectWindow(GSF_INDUSTRYTILES, tile_cur);
|
||||
@@ -165,7 +165,7 @@ Industry::~Industry()
|
||||
|
||||
if (has_neutral_station) {
|
||||
/* Remove possible docking tiles */
|
||||
TILE_AREA_LOOP(tile_cur, this->location) {
|
||||
for (TileIndex tile_cur : this->location) {
|
||||
ClearDockingTilesCheckingNeighbours(tile_cur);
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ Industry::~Industry()
|
||||
TileArea ta = TileArea(this->location.tile, 0, 0).Expand(21);
|
||||
|
||||
/* Remove the farmland and convert it to regular tiles over time. */
|
||||
TILE_AREA_LOOP(tile_cur, ta) {
|
||||
for (TileIndex tile_cur : ta) {
|
||||
if (IsTileType(tile_cur, MP_CLEAR) && IsClearGround(tile_cur, CLEAR_FIELDS) &&
|
||||
GetIndustryIndexOfField(tile_cur) == this->index) {
|
||||
SetIndustryIndexOfField(tile_cur, INVALID_INDUSTRY);
|
||||
@@ -1085,7 +1085,7 @@ static void PlantFarmField(TileIndex tile, IndustryID industry)
|
||||
|
||||
/* check the amount of bad tiles */
|
||||
int count = 0;
|
||||
TILE_AREA_LOOP(cur_tile, ta) {
|
||||
for (TileIndex cur_tile : ta) {
|
||||
assert(cur_tile < MapSize());
|
||||
count += IsSuitableForFarmField(cur_tile, false);
|
||||
}
|
||||
@@ -1097,7 +1097,7 @@ static void PlantFarmField(TileIndex tile, IndustryID industry)
|
||||
uint field_type = GB(r, 8, 8) * 9 >> 8;
|
||||
|
||||
/* make field */
|
||||
TILE_AREA_LOOP(cur_tile, ta) {
|
||||
for (TileIndex cur_tile : ta) {
|
||||
assert(cur_tile < MapSize());
|
||||
if (IsSuitableForFarmField(cur_tile, true)) {
|
||||
MakeField(cur_tile, field_type, industry);
|
||||
@@ -1159,7 +1159,7 @@ static bool SearchLumberMillTrees(TileIndex tile, void *user_data)
|
||||
static void ChopLumberMillTrees(Industry *i)
|
||||
{
|
||||
/* We only want to cut trees if all tiles are completed. */
|
||||
TILE_AREA_LOOP(tile_cur, i->location) {
|
||||
for (TileIndex tile_cur : i->location) {
|
||||
if (i->TileBelongsToIndustry(tile_cur)) {
|
||||
if (!IsIndustryCompleted(tile_cur)) return;
|
||||
}
|
||||
@@ -1604,7 +1604,7 @@ static bool CheckCanTerraformSurroundingTiles(TileIndex tile, uint height, int i
|
||||
if (TileX(tile) == 0 || TileY(tile) == 0 || GetTileType(tile) == MP_VOID) return false;
|
||||
|
||||
TileArea ta(tile - TileDiffXY(1, 1), 2, 2);
|
||||
TILE_AREA_LOOP(tile_walk, ta) {
|
||||
for (TileIndex tile_walk : ta) {
|
||||
uint curh = TileHeight(tile_walk);
|
||||
/* Is the tile clear? */
|
||||
if ((GetTileType(tile_walk) != MP_CLEAR) && (GetTileType(tile_walk) != MP_TREES)) return false;
|
||||
@@ -1659,7 +1659,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags,
|
||||
* Perform terraforming as OWNER_TOWN to disable autoslope and town ratings. */
|
||||
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
|
||||
|
||||
TILE_AREA_LOOP(tile_walk, ta) {
|
||||
for (TileIndex tile_walk : ta) {
|
||||
uint curh = TileHeight(tile_walk);
|
||||
if (curh != h) {
|
||||
/* This tile needs terraforming. Check if we can do that without
|
||||
@@ -1679,7 +1679,7 @@ static bool CheckIfCanLevelIndustryPlatform(TileIndex tile, DoCommandFlag flags,
|
||||
|
||||
if (flags & DC_EXEC) {
|
||||
/* Terraform the land under the industry */
|
||||
TILE_AREA_LOOP(tile_walk, ta) {
|
||||
for (TileIndex tile_walk : ta) {
|
||||
uint curh = TileHeight(tile_walk);
|
||||
while (curh != h) {
|
||||
/* We give the terraforming for free here, because we can't calculate
|
||||
@@ -1711,7 +1711,7 @@ static CommandCost CheckIfFarEnoughFromConflictingIndustry(TileIndex tile, int t
|
||||
if (Industry::GetNumItems() > (size_t) (dmax * dmax * 2)) {
|
||||
const Industry* i = nullptr;
|
||||
TileArea tile_area = TileArea(tile, 1, 1).Expand(dmax);
|
||||
TILE_AREA_LOOP(atile, tile_area) {
|
||||
for (TileIndex atile : tile_area) {
|
||||
if (GetTileType(atile) == MP_INDUSTRY) {
|
||||
const Industry *i2 = Industry::GetByTile(atile);
|
||||
if (i == i2) continue;
|
||||
|
Reference in New Issue
Block a user