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:
@@ -114,7 +114,7 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
|
||||
|
||||
assert(o->town != nullptr);
|
||||
|
||||
TILE_AREA_LOOP(t, ta) {
|
||||
for (TileIndex t : ta) {
|
||||
if (IsWaterTile(t)) ClearNeighbourNonFloodingStates(t);
|
||||
WaterClass wc = (IsWaterTile(t) ? GetWaterClass(t) : WATER_CLASS_INVALID);
|
||||
/* Update company infrastructure counts for objects build on canals owned by nobody. */
|
||||
@@ -137,7 +137,7 @@ void BuildObject(ObjectType type, TileIndex tile, CompanyID owner, Town *town, u
|
||||
static void IncreaseAnimationStage(TileIndex tile)
|
||||
{
|
||||
TileArea ta = Object::GetByTile(tile)->location;
|
||||
TILE_AREA_LOOP(t, ta) {
|
||||
for (TileIndex t : ta) {
|
||||
SetAnimationFrame(t, GetAnimationFrame(t) + 1);
|
||||
MarkTileDirtyByTile(t, VMDF_NOT_MAP_MODE);
|
||||
}
|
||||
@@ -223,7 +223,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
int size_x = GB(spec->size, HasBit(view, 0) ? 4 : 0, 4);
|
||||
int size_y = GB(spec->size, HasBit(view, 0) ? 0 : 4, 4);
|
||||
TileArea ta(tile, size_x, size_y);
|
||||
TILE_AREA_LOOP(t, ta) {
|
||||
for (TileIndex t : ta) {
|
||||
if (!IsValidTile(t)) return_cmd_error(STR_ERROR_TOO_CLOSE_TO_EDGE_OF_MAP_SUB); // Might be off the map
|
||||
}
|
||||
|
||||
@@ -237,7 +237,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
* some information about the tiles. */
|
||||
bool allow_water = (spec->flags & (OBJECT_FLAG_BUILT_ON_WATER | OBJECT_FLAG_NOT_ON_LAND)) != 0;
|
||||
bool allow_ground = (spec->flags & OBJECT_FLAG_NOT_ON_LAND) == 0;
|
||||
TILE_AREA_LOOP(t, ta) {
|
||||
for (TileIndex t : ta) {
|
||||
if (HasTileWaterGround(t)) {
|
||||
if (!allow_water) return_cmd_error(STR_ERROR_CAN_T_BUILD_ON_WATER);
|
||||
if (!IsWaterTile(t)) {
|
||||
@@ -270,7 +270,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
int allowed_z;
|
||||
if (GetTileSlope(tile, &allowed_z) != SLOPE_FLAT) allowed_z++;
|
||||
|
||||
TILE_AREA_LOOP(t, ta) {
|
||||
for (TileIndex t : ta) {
|
||||
uint16 callback = CALLBACK_FAILED;
|
||||
if (HasBit(spec->callback_mask, CBM_OBJ_SLOPE_CHECK)) {
|
||||
TileIndex diff = t - tile;
|
||||
@@ -290,7 +290,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
if (flags & DC_EXEC) {
|
||||
/* This is basically a copy of the loop above with the exception that we now
|
||||
* execute the commands and don't check for errors, since that's already done. */
|
||||
TILE_AREA_LOOP(t, ta) {
|
||||
for (TileIndex t : ta) {
|
||||
if (HasTileWaterGround(t)) {
|
||||
if (!IsWaterTile(t)) {
|
||||
DoCommand(t, 0, 0, (flags & ~DC_NO_WATER) | DC_NO_MODIFY_TOWN_RATING, CMD_LANDSCAPE_CLEAR);
|
||||
@@ -305,7 +305,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
|
||||
/* Finally do a check for bridges. */
|
||||
if (type < NEW_OBJECT_OFFSET || !_settings_game.construction.allow_grf_objects_under_bridges) {
|
||||
TILE_AREA_LOOP(t, ta) {
|
||||
for (TileIndex t : ta) {
|
||||
if (IsBridgeAbove(t) && (
|
||||
!(spec->flags & OBJECT_FLAG_ALLOW_UNDER_BRIDGE) ||
|
||||
(GetTileMaxZ(t) + spec->height >= GetBridgeHeight(GetSouthernBridgeEnd(t))))) {
|
||||
@@ -588,7 +588,7 @@ static Foundation GetFoundation_Object(TileIndex tile, Slope tileh)
|
||||
static void ReallyClearObjectTile(Object *o)
|
||||
{
|
||||
Object::DecTypeCount(o->type);
|
||||
TILE_AREA_LOOP(tile_cur, o->location) {
|
||||
for (TileIndex tile_cur : o->location) {
|
||||
DeleteNewGRFInspectWindow(GSF_OBJECTS, tile_cur);
|
||||
|
||||
MakeWaterKeepingClass(tile_cur, GetTileOwner(tile_cur));
|
||||
|
Reference in New Issue
Block a user