diff --git a/src/lang/english.txt b/src/lang/english.txt index 759b7ea367..50c47177cb 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -2476,6 +2476,9 @@ STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_HELPTEXT :Objects which w STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_VALUE :{NUM} STR_CONFIG_SETTING_NO_EXPIRE_OBJECTS_AFTER_ZERO :Off +STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES :Ignore object introduction dates: {STRING2} +STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT :Set whether players are allowed to build objects before their introduction date.{}Does not apply to objects constructed during map generation. + STR_PURCHASE_LAND_PERMITTED_NO :No STR_PURCHASE_LAND_PERMITTED_SINGLE :Yes, 1 tile at a time STR_PURCHASE_LAND_PERMITTED_AREA :Yes, large areas at a time diff --git a/src/newgrf_object.cpp b/src/newgrf_object.cpp index 6128fdf520..8a8de90792 100644 --- a/src/newgrf_object.cpp +++ b/src/newgrf_object.cpp @@ -70,7 +70,7 @@ bool ObjectSpec::IsEverAvailable() const */ bool ObjectSpec::WasEverAvailable() const { - return this->IsEverAvailable() && _date > this->introduction_date; + return this->IsEverAvailable() && (_date > this->introduction_date || (_settings_game.construction.ignore_object_intro_dates && !_generating_world)); } /** diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 6352426db6..069a0d7120 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -2089,6 +2089,7 @@ static SettingsContainer &GetSettingsTree() limitations->Add(new SettingEntry("construction.purchase_land_permitted")); limitations->Add(new SettingEntry("construction.build_object_area_permitted")); limitations->Add(new SettingEntry("construction.no_expire_objects_after")); + limitations->Add(new SettingEntry("construction.ignore_object_intro_dates")); } SettingsPage *disasters = main->Add(new SettingsPage(STR_CONFIG_SETTING_ACCIDENTS)); diff --git a/src/settings_type.h b/src/settings_type.h index c857e77d71..bde815dc52 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -455,6 +455,7 @@ struct ConstructionSettings { byte purchase_land_permitted; ///< whether and how purchasing land is permitted bool build_object_area_permitted; ///< whether building objects by area is permitted Year no_expire_objects_after; ///< do not expire objects after this year + bool ignore_object_intro_dates; ///< allow players to build objects before their introduction dates (does not include during map generation) uint32 terraform_per_64k_frames; ///< how many tile heights may, over a long period, be terraformed per 65536 frames? uint16 terraform_frame_burst; ///< how many tile heights may, over a short period, be terraformed? diff --git a/src/table/settings/settings.ini b/src/table/settings/settings.ini index f20bca5e6d..874e7da594 100644 --- a/src/table/settings/settings.ini +++ b/src/table/settings/settings.ini @@ -2093,6 +2093,14 @@ cat = SC_ADVANCED patxname = ""construction.no_expire_objects_after"" post_cb = [](auto) { InvalidateWindowClassesData(WC_BUILD_OBJECT, 0); } +[SDT_BOOL] +var = construction.ignore_object_intro_dates +def = false +str = STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES +strhelp = STR_CONFIG_SETTING_IGNORE_OBJECT_INTRO_DATES_HELPTEXT +patxname = ""construction.ignore_object_intro_dates"" +post_cb = [](auto) { InvalidateWindowClassesData(WC_BUILD_OBJECT, 0); } + [SDT_BOOL] var = station.adjacent_stations from = SLV_62