Merge branch 'master' into jgrpp

# Conflicts:
#	src/bridge_map.h
#	src/crashlog.cpp
#	src/industry.h
#	src/linkgraph/linkgraph_type.h
#	src/order_type.h
#	src/saveload/afterload.cpp
#	src/settings.cpp
#	src/settings_type.h
#	src/smallmap_gui.cpp
#	src/spritecache.cpp
#	src/stdafx.h
#	src/table/settings.h.preamble
#	src/train.h
#	src/vehicle.cpp
#	src/viewport.cpp
#	src/viewport_func.h
#	src/widgets/station_widget.h
#	src/zoom_func.h
#	src/zoom_type.h
This commit is contained in:
Jonathan G Rennison
2019-07-08 16:19:07 +01:00
136 changed files with 706 additions and 501 deletions

View File

@@ -182,7 +182,7 @@ void Town::InitializeLayout(TownLayout layout)
return;
}
this->layout = TileHash(TileX(this->xy), TileY(this->xy)) % (NUM_TLS - 1);
this->layout = static_cast<TownLayout>(TileHash(TileX(this->xy), TileY(this->xy)) % (NUM_TLS - 1));
}
/**
@@ -776,7 +776,7 @@ static void TileLoop_Town(TileIndex tile)
}
}
Backup<CompanyByte> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
if ((hs->building_flags & BUILDING_HAS_1_TILE) &&
HasBit(t->flags, TOWN_IS_GROWING) &&
@@ -1762,7 +1762,7 @@ static bool GrowTown(Town *t)
};
/* Current "company" is a town */
Backup<CompanyByte> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
TileIndex tile = t->xy; // The tile we are working with ATM
@@ -2240,7 +2240,7 @@ static Town *CreateRandomTown(uint attempts, uint32 townnameparts, TownSize size
* placement is so bad it couldn't grow at all */
if (t->cache.population > 0) return t;
Backup<CompanyByte> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
Backup<CompanyID> cur_company(_current_company, OWNER_TOWN, FILE_LINE);
CommandCost rc = DoCommand(t->xy, t->index, 0, DC_EXEC, CMD_DELETE_TOWN);
cur_company.Restore();
assert(rc.Succeeded());
@@ -3214,7 +3214,7 @@ static CommandCost TownActionRoadRebuild(Town *t, DoCommandFlag flags)
*/
static bool TryClearTile(TileIndex tile)
{
Backup<CompanyByte> cur_company(_current_company, OWNER_NONE, FILE_LINE);
Backup<CompanyID> cur_company(_current_company, OWNER_NONE, FILE_LINE);
CommandCost r = DoCommand(tile, 0, 0, DC_NONE, CMD_LANDSCAPE_CLEAR);
cur_company.Restore();
return r.Succeeded();
@@ -3286,7 +3286,7 @@ static CommandCost TownActionBuildStatue(Town *t, DoCommandFlag flags)
if (!CircularTileSearch(&tile, 9, SearchTileForStatue, &statue_data)) return_cmd_error(STR_ERROR_STATUE_NO_SUITABLE_PLACE);
if (flags & DC_EXEC) {
Backup<CompanyByte> cur_company(_current_company, OWNER_NONE, FILE_LINE);
Backup<CompanyID> cur_company(_current_company, OWNER_NONE, FILE_LINE);
DoCommand(statue_data.best_position, 0, 0, DC_EXEC, CMD_LANDSCAPE_CLEAR);
cur_company.Restore();
BuildObject(OBJECT_STATUE, statue_data.best_position, _current_company, t);