summaryrefslogtreecommitdiff
path: root/src/rail.h
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-01-08 10:16:18 +0000
committerGitHub <noreply@github.com>2021-01-08 11:16:18 +0100
commit9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch)
tree3f287d339e15c4902ee415556475fd9b2918d33c /src/rail.h
parentc1fddb9a6ae5c3af6865461a7295788a341011a2 (diff)
downloadopenttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/rail.h')
-rw-r--r--src/rail.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rail.h b/src/rail.h
index d9121d545..c5775b946 100644
--- a/src/rail.h
+++ b/src/rail.h
@@ -388,7 +388,7 @@ static inline Money RailClearCost(RailType railtype)
* cost.
*/
assert(railtype < RAILTYPE_END);
- return max(_price[PR_CLEAR_RAIL], -RailBuildCost(railtype) * 3 / 4);
+ return std::max(_price[PR_CLEAR_RAIL], -RailBuildCost(railtype) * 3 / 4);
}
/**
@@ -408,8 +408,8 @@ static inline Money RailConvertCost(RailType from, RailType to)
* build costs, if the target type is more expensive (material upgrade costs).
* Upgrade can never be more expensive than re-building. */
if (HasPowerOnRail(from, to) || HasPowerOnRail(to, from)) {
- Money upgradecost = RailBuildCost(to) / 8 + max((Money)0, RailBuildCost(to) - RailBuildCost(from));
- return min(upgradecost, rebuildcost);
+ Money upgradecost = RailBuildCost(to) / 8 + std::max((Money)0, RailBuildCost(to) - RailBuildCost(from));
+ return std::min(upgradecost, rebuildcost);
}
/* make the price the same as remove + build new type for rail types