Add setting to disable object expiry after a given year

This commit is contained in:
Jonathan G Rennison
2022-06-02 13:29:03 +01:00
parent 30f74c5b74
commit 6fce46304a
5 changed files with 26 additions and 3 deletions

View File

@@ -80,7 +80,8 @@ bool ObjectSpec::WasEverAvailable() const
bool ObjectSpec::IsAvailable() const
{
return this->WasEverAvailable() &&
(_date < this->end_of_life_date || this->end_of_life_date < this->introduction_date + 365);
(_date < this->end_of_life_date || this->end_of_life_date < this->introduction_date + 365 ||
(_settings_game.construction.no_expire_objects_after != 0 && _cur_year >= _settings_game.construction.no_expire_objects_after));
}
/**