mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Rename _ignore_restrictions to _ignore_industry_restrictions.
parent
c9c9973884
commit
b0d678e375
|
@ -1321,7 +1321,7 @@ static CommandCost CheckNewIndustry_OilRefinery(TileIndex tile)
|
||||||
return CommandCost(STR_ERROR_CAN_ONLY_BE_POSITIONED);
|
return CommandCost(STR_ERROR_CAN_ONLY_BE_POSITIONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern bool _ignore_restrictions;
|
extern bool _ignore_industry_restrictions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check the conditions of #CHECK_OIL_RIG (Industries at sea should be positioned near edge of the map).
|
* Check the conditions of #CHECK_OIL_RIG (Industries at sea should be positioned near edge of the map).
|
||||||
|
@ -1330,7 +1330,7 @@ extern bool _ignore_restrictions;
|
||||||
*/
|
*/
|
||||||
static CommandCost CheckNewIndustry_OilRig(TileIndex tile)
|
static CommandCost CheckNewIndustry_OilRig(TileIndex tile)
|
||||||
{
|
{
|
||||||
if (_game_mode == GM_EDITOR && _ignore_restrictions) return CommandCost();
|
if (_game_mode == GM_EDITOR && _ignore_industry_restrictions) return CommandCost();
|
||||||
|
|
||||||
if (TileHeight(tile) == 0 &&
|
if (TileHeight(tile) == 0 &&
|
||||||
CheckScaledDistanceFromEdge(TileAddXY(tile, 1, 1), _settings_game.game_creation.oil_refinery_limit)) return CommandCost();
|
CheckScaledDistanceFromEdge(TileAddXY(tile, 1, 1), _settings_game.game_creation.oil_refinery_limit)) return CommandCost();
|
||||||
|
@ -1566,7 +1566,7 @@ static CommandCost CheckIfIndustryTileSlopes(TileIndex tile, const IndustryTileL
|
||||||
/* It is almost impossible to have a fully flat land in TG, so what we
|
/* It is almost impossible to have a fully flat land in TG, so what we
|
||||||
* do is that we check if we can make the land flat later on. See
|
* do is that we check if we can make the land flat later on. See
|
||||||
* CheckIfCanLevelIndustryPlatform(). */
|
* CheckIfCanLevelIndustryPlatform(). */
|
||||||
if (!refused_slope || (_settings_game.game_creation.land_generator == LG_TERRAGENESIS && _generating_world && !custom_shape && !_ignore_restrictions)) {
|
if (!refused_slope || (_settings_game.game_creation.land_generator == LG_TERRAGENESIS && _generating_world && !custom_shape && !_ignore_industry_restrictions)) {
|
||||||
return CommandCost();
|
return CommandCost();
|
||||||
}
|
}
|
||||||
return CommandCost(STR_ERROR_SITE_UNSUITABLE);
|
return CommandCost(STR_ERROR_SITE_UNSUITABLE);
|
||||||
|
@ -2023,7 +2023,7 @@ static CommandCost CreateNewIndustryHelper(TileIndex tile, IndustryType type, Do
|
||||||
if (ret.Failed()) return ret;
|
if (ret.Failed()) return ret;
|
||||||
|
|
||||||
if (!custom_shape_check && _settings_game.game_creation.land_generator == LG_TERRAGENESIS && _generating_world &&
|
if (!custom_shape_check && _settings_game.game_creation.land_generator == LG_TERRAGENESIS && _generating_world &&
|
||||||
!_ignore_restrictions && !CheckIfCanLevelIndustryPlatform(tile, DoCommandFlag::NoWater, layout)) {
|
!_ignore_industry_restrictions && !CheckIfCanLevelIndustryPlatform(tile, DoCommandFlag::NoWater, layout)) {
|
||||||
return CommandCost(STR_ERROR_SITE_UNSUITABLE);
|
return CommandCost(STR_ERROR_SITE_UNSUITABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
|
|
||||||
#include "safeguards.h"
|
#include "safeguards.h"
|
||||||
|
|
||||||
bool _ignore_restrictions;
|
bool _ignore_industry_restrictions;
|
||||||
std::bitset<NUM_INDUSTRYTYPES> _displayed_industries; ///< Communication from the industry chain window to the smallmap window about what industries to display.
|
std::bitset<NUM_INDUSTRYTYPES> _displayed_industries; ///< Communication from the industry chain window to the smallmap window about what industries to display.
|
||||||
|
|
||||||
/** Cargo suffix type (for which window is it requested) */
|
/** Cargo suffix type (for which window is it requested) */
|
||||||
|
@ -722,15 +722,11 @@ public:
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Backup<CompanyID> cur_company(_current_company, OWNER_NONE);
|
AutoRestoreBackup backup_cur_company(_current_company, OWNER_NONE);
|
||||||
Backup<bool> old_generating_world(_generating_world, true);
|
AutoRestoreBackup backup_generating_world(_generating_world, true);
|
||||||
_ignore_restrictions = true;
|
AutoRestoreBackup backup_ignore_industry_restritions(_ignore_industry_restrictions, true);
|
||||||
|
|
||||||
Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, this->selected_type, layout_index, false, seed);
|
Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, &CcBuildIndustry, tile, this->selected_type, layout_index, false, seed);
|
||||||
|
|
||||||
cur_company.Restore();
|
|
||||||
old_generating_world.Restore();
|
|
||||||
_ignore_restrictions = false;
|
|
||||||
} else {
|
} else {
|
||||||
success = Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, this->selected_type, layout_index, false, seed);
|
success = Command<CMD_BUILD_INDUSTRY>::Post(STR_ERROR_CAN_T_CONSTRUCT_THIS_INDUSTRY, tile, this->selected_type, layout_index, false, seed);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue