1
0
Fork 0

Feature: Setting to allow bulldozing immovable objects

pull/13265/head
Tyler Trahan 2025-01-03 15:35:35 -05:00
parent 4d23dccaca
commit b564013ca1
5 changed files with 15 additions and 3 deletions

View File

@ -1398,6 +1398,9 @@ STR_CONFIG_SETTING_MULTIPINDTOWN_HELPTEXT :Normally, a tow
STR_CONFIG_SETTING_BULLDOZE_INDUSTRIES :Allow bulldozing unserved industries
STR_CONFIG_SETTING_BULLDOZE_INDUSTRIES_HELPTEXT :Allow industries to be demolished if 0% of their output is currently being transported
STR_CONFIG_SETTING_BULLDOZE_OBJECTS :Allow bulldozing immovable objects
STR_CONFIG_SETTING_BULLDOZE_OBJECTS_HELPTEXT :Allow lighthouses, transmitters, and NewGRF objects to be demolished
STR_CONFIG_SETTING_SIGNALSIDE :Show signals: {STRING2}
STR_CONFIG_SETTING_SIGNALSIDE_HELPTEXT :Select on which side of the track to place signals
###length 3

View File

@ -566,13 +566,13 @@ static CommandCost ClearTile_Object(TileIndex tile, DoCommandFlag flags)
/* No further limitations for the editor. */
} else if (GetTileOwner(tile) == OWNER_NONE) {
/* Owned by nobody and unremovable, so we can only remove it with brute force! */
if (!_cheats.magic_bulldozer.value && (spec->flags & OBJECT_FLAG_CANNOT_REMOVE) != 0) return CMD_ERROR;
if (!_settings_game.construction.bulldoze_objects && (spec->flags & OBJECT_FLAG_CANNOT_REMOVE) != 0) return CMD_ERROR;
} else if (CheckTileOwnership(tile).Failed()) {
/* We don't own it!. */
return CommandCost(STR_ERROR_OWNED_BY);
} else if ((spec->flags & OBJECT_FLAG_CANNOT_REMOVE) != 0 && (spec->flags & OBJECT_FLAG_AUTOREMOVE) == 0) {
/* In the game editor or with cheats we can remove, otherwise we can't. */
if (!_cheats.magic_bulldozer.value) {
/* We might be allowed to remove immovable objects. */
if (!_settings_game.construction.bulldoze_objects) {
if (type == OBJECT_HQ) return CommandCost(STR_ERROR_COMPANY_HEADQUARTERS_IN);
return CMD_ERROR;
}

View File

@ -2150,6 +2150,7 @@ static SettingsContainer &GetSettingsTree()
limitations->Add(new SettingEntry("construction.autoslope"));
limitations->Add(new SettingEntry("construction.extra_dynamite"));
limitations->Add(new SettingEntry("construction.bulldoze_industries"));
limitations->Add(new SettingEntry("construction.bulldoze_objects"));
limitations->Add(new SettingEntry("construction.map_height_limit"));
limitations->Add(new SettingEntry("construction.max_bridge_length"));
limitations->Add(new SettingEntry("construction.max_bridge_height"));

View File

@ -393,6 +393,7 @@ struct ConstructionSettings {
uint8_t raw_industry_construction; ///< type of (raw) industry construction (none, "normal", prospecting)
uint8_t industry_platform; ///< the amount of flat land around an industry
bool bulldoze_industries; ///< whether players can bulldozed unserved industries
bool bulldoze_objects; ///< whether objects can be bulldozed, even if immovable
bool freeform_edges; ///< allow terraforming the tiles at the map edges
uint8_t extra_tree_placement; ///< (dis)allow building extra trees in-game
uint8_t command_pause_level; ///< level/amount of commands that can't be executed while paused

View File

@ -567,6 +567,13 @@ str = STR_CONFIG_SETTING_BULLDOZE_INDUSTRIES
strhelp = STR_CONFIG_SETTING_BULLDOZE_INDUSTRIES_HELPTEXT
cat = SC_BASIC
[SDT_BOOL]
var = construction.bulldoze_objects
def = false
str = STR_CONFIG_SETTING_BULLDOZE_OBJECTS
strhelp = STR_CONFIG_SETTING_BULLDOZE_OBJECTS_HELPTEXT
cat = SC_BASIC
[SDT_BOOL]
var = construction.freeform_edges
from = SLV_111