Merge branch 'master' into jgrpp

# Conflicts:
#	src/animated_tile.cpp
#	src/cargopacket.h
#	src/cheat_gui.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/date.cpp
#	src/disaster_vehicle.cpp
#	src/dock_gui.cpp
#	src/economy.cpp
#	src/engine.cpp
#	src/error_gui.cpp
#	src/fontcache/spritefontcache.cpp
#	src/game/game_gui.cpp
#	src/game/game_text.cpp
#	src/gfx.cpp
#	src/graph_gui.cpp
#	src/highscore_gui.cpp
#	src/industry_cmd.cpp
#	src/lang/dutch.txt
#	src/lang/english_AU.txt
#	src/lang/english_US.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/italian.txt
#	src/lang/portuguese.txt
#	src/lang/russian.txt
#	src/lang/turkish.txt
#	src/lang/vietnamese.txt
#	src/main_gui.cpp
#	src/misc_gui.cpp
#	src/network/network_gui.cpp
#	src/network/network_server.cpp
#	src/newgrf.cpp
#	src/newgrf.h
#	src/newgrf_generic.cpp
#	src/news_gui.cpp
#	src/openttd.cpp
#	src/os/unix/unix.cpp
#	src/os/windows/font_win32.cpp
#	src/os/windows/win32.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/saveload/afterload.cpp
#	src/saveload/misc_sl.cpp
#	src/saveload/oldloader_sl.cpp
#	src/saveload/saveload.cpp
#	src/saveload/saveload.h
#	src/script/script_gui.cpp
#	src/settings_table.cpp
#	src/signs_gui.cpp
#	src/smallmap_gui.cpp
#	src/smallmap_gui.h
#	src/spritecache.cpp
#	src/spritecache.h
#	src/spriteloader/grf.cpp
#	src/station_cmd.cpp
#	src/statusbar_gui.cpp
#	src/stdafx.h
#	src/strgen/strgen_base.cpp
#	src/subsidy.cpp
#	src/table/settings/difficulty_settings.ini
#	src/texteff.cpp
#	src/timetable_cmd.cpp
#	src/timetable_gui.cpp
#	src/toolbar_gui.cpp
#	src/town_cmd.cpp
#	src/town_gui.cpp
#	src/townname.cpp
#	src/vehicle.cpp
#	src/waypoint_cmd.cpp
#	src/widgets/dropdown.cpp
#	src/window.cpp
This commit is contained in:
Jonathan G Rennison
2023-05-26 19:36:48 +01:00
170 changed files with 1526 additions and 1238 deletions

View File

@@ -74,21 +74,16 @@ IndustryBuildData _industry_builder; ///< In-game manager of industries.
*/
void ResetIndustries()
{
for (IndustryType i = 0; i < NUM_INDUSTRYTYPES; i++) {
/* Reset the spec to default */
if (i < lengthof(_origin_industry_specs)) {
_industry_specs[i] = _origin_industry_specs[i];
} else {
_industry_specs[i] = IndustrySpec{};
}
auto industry_insert = std::copy(std::begin(_origin_industry_specs), std::end(_origin_industry_specs), std::begin(_industry_specs));
std::fill(industry_insert, std::end(_industry_specs), IndustrySpec{});
for (IndustryType i = 0; i < lengthof(_origin_industry_specs); i++) {
/* Enable only the current climate industries */
_industry_specs[i].enabled = i < NEW_INDUSTRYOFFSET &&
HasBit(_origin_industry_specs[i].climate_availability, _settings_game.game_creation.landscape);
_industry_specs[i].enabled = HasBit(_industry_specs[i].climate_availability, _settings_game.game_creation.landscape);
}
memset(&_industry_tile_specs, 0, sizeof(_industry_tile_specs));
memcpy(&_industry_tile_specs, &_origin_industry_tile_specs, sizeof(_origin_industry_tile_specs));
auto industry_tile_insert = std::copy(std::begin(_origin_industry_tile_specs), std::end(_origin_industry_tile_specs), std::begin(_industry_tile_specs));
std::fill(industry_tile_insert, std::end(_industry_tile_specs), IndustryTileSpec{});
/* Reset any overrides that have been set. */
_industile_mngr.ResetOverride();
@@ -195,8 +190,8 @@ Industry::~Industry()
DeleteWindowById(WC_INDUSTRY_VIEW, this->index);
DeleteNewGRFInspectWindow(GSF_INDUSTRIES, this->index);
DeleteSubsidyWith(ST_INDUSTRY, this->index);
CargoPacket::InvalidateAllFrom(ST_INDUSTRY, this->index);
DeleteSubsidyWith(SourceType::Industry, this->index);
CargoPacket::InvalidateAllFrom(SourceType::Industry, this->index);
for (Station *st : this->stations_near) {
st->RemoveIndustryToDeliver(this);
@@ -546,7 +541,7 @@ static bool TransportIndustryGoods(TileIndex tile)
i->this_month_production[j] = std::min<uint>(i->this_month_production[j] + cw, 0xFFFF);
uint am = MoveGoodsToStation(i->produced_cargo[j], cw, ST_INDUSTRY, i->index, &i->stations_near, i->exclusive_consumer);
uint am = MoveGoodsToStation(i->produced_cargo[j], cw, SourceType::Industry, i->index, &i->stations_near, i->exclusive_consumer);
i->this_month_transported[j] += am;
moved_cargo |= (am != 0);