Split date types into calendar and economy dates

See: 735abfe1
This commit is contained in:
Jonathan G Rennison
2024-02-13 21:34:09 +00:00
parent fad5ee56e7
commit 7ce06e22b8
141 changed files with 1325 additions and 1082 deletions

View File

@@ -81,9 +81,9 @@ AirportSpec AirportSpec::specs[NUM_AIRPORTS]; ///< Airport specifications.
bool AirportSpec::IsAvailable() const
{
if (!this->enabled) return false;
if (_cur_year < this->min_year) return false;
if (CalTime::CurYear() < this->min_year) return false;
if (_settings_game.station.never_expire_airports) return true;
return _cur_year <= this->max_year;
return CalTime::CurYear() <= this->max_year;
}
/**
@@ -169,7 +169,7 @@ void AirportOverrideManager::SetEntitySpec(AirportSpec *as)
case 0x7C: return (this->st->airport.psa != nullptr) ? this->st->airport.psa->GetValue(parameter) : 0;
case 0xF0: return this->st->facilities;
case 0xFA: return ClampTo<uint16_t>((this->st->build_date - DAYS_TILL_ORIGINAL_BASE_YEAR).base());
case 0xFA: return ClampTo<uint16_t>((this->st->build_date - CalTime::DAYS_TILL_ORIGINAL_BASE_YEAR).base());
}
return this->st->GetNewGRFVariable(this->ro, variable, parameter, &(extra->available));