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/ground_vehicle.hpp | |
parent | c1fddb9a6ae5c3af6865461a7295788a341011a2 (diff) | |
download | openttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz |
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/ground_vehicle.hpp')
-rw-r--r-- | src/ground_vehicle.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ground_vehicle.hpp b/src/ground_vehicle.hpp index af6e25c80..15aac1f36 100644 --- a/src/ground_vehicle.hpp +++ b/src/ground_vehicle.hpp @@ -369,7 +369,7 @@ protected: * somewhat gradually. But never lower than the maximum speed. */ int tempmax = max_speed; if (this->cur_speed > max_speed) { - tempmax = max(this->cur_speed - (this->cur_speed / 10) - 1, max_speed); + tempmax = std::max(this->cur_speed - (this->cur_speed / 10) - 1, max_speed); } /* Enforce a maximum and minimum speed. Normally we would use something like @@ -377,7 +377,7 @@ protected: * threshold for some reason. That makes acceleration fail and assertions * happen in Clamp. So make it explicit that min_speed overrules the maximum * speed by explicit ordering of min and max. */ - this->cur_speed = spd = max(min(this->cur_speed + ((int)spd >> 8), tempmax), min_speed); + this->cur_speed = spd = std::max(std::min(this->cur_speed + ((int)spd >> 8), tempmax), min_speed); int scaled_spd = this->GetAdvanceSpeed(spd); |