diff options
author | Charles Pigott <charlespigott@googlemail.com> | 2021-01-08 10:16:18 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-08 11:16:18 +0100 |
commit | 9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch) | |
tree | 3f287d339e15c4902ee415556475fd9b2918d33c /src/engine.cpp | |
parent | c1fddb9a6ae5c3af6865461a7295788a341011a2 (diff) | |
download | openttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz |
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/engine.cpp')
-rw-r--r-- | src/engine.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/engine.cpp b/src/engine.cpp index 72da8702f..2681b8fa6 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -578,7 +578,7 @@ static void CalcEngineReliability(Engine *e) /* Check for early retirement */ if (e->company_avail != 0 && !_settings_game.vehicle.never_expire_vehicles && e->info.base_life != 0xFF) { int retire_early = e->info.retire_early; - uint retire_early_max_age = max(0, e->duration_phase_1 + e->duration_phase_2 - retire_early * 12); + uint retire_early_max_age = std::max(0, e->duration_phase_1 + e->duration_phase_2 - retire_early * 12); if (retire_early != 0 && age >= retire_early_max_age) { /* Early retirement is enabled and we're past the date... */ e->company_avail = 0; @@ -625,7 +625,7 @@ void SetYearEngineAgingStops() YearMonthDay ymd; ConvertDateToYMD(ei->base_intro + (ei->lifelength * DAYS_IN_LEAP_YEAR) / 2, &ymd); - _year_engine_aging_stops = max(_year_engine_aging_stops, ymd.year); + _year_engine_aging_stops = std::max(_year_engine_aging_stops, ymd.year); } } @@ -693,7 +693,7 @@ void StartupOneEngine(Engine *e, Date aging_date) void StartupEngines() { /* Aging of vehicles stops, so account for that when starting late */ - const Date aging_date = min(_date, ConvertYMDToDate(_year_engine_aging_stops, 0, 1)); + const Date aging_date = std::min(_date, ConvertYMDToDate(_year_engine_aging_stops, 0, 1)); for (Engine *e : Engine::Iterate()) { StartupOneEngine(e, aging_date); @@ -1196,7 +1196,7 @@ void CheckEngines() if ((e->flags & ENGINE_AVAILABLE) != 0 && e->company_avail != 0) return; /* Okay, try to find the earliest date. */ - min_date = min(min_date, e->info.base_intro); + min_date = std::min(min_date, e->info.base_intro); } if (min_date < INT32_MAX) { |