mirror of https://github.com/OpenRCT2/OpenRCT2.git
Part of #21421: using std::numerics for finding bounds
This commit is contained in:
parent
c4cc84c454
commit
c32020bb96
|
@ -501,8 +501,10 @@ std::vector<uint8_t> Ungzip(const void* data, const size_t dataLen)
|
|||
return output;
|
||||
}
|
||||
|
||||
template<typename T> constexpr T kAddClampBody(T value, T value_to_add, T min_cap, T max_cap)
|
||||
template<typename T> constexpr T kAddClampBody(T value, T value_to_add)
|
||||
{
|
||||
auto max_cap = std::numeric_limits<T>::max();
|
||||
auto min_cap = std::numeric_limits<T>::lowest();
|
||||
if ((value_to_add > 0) && (value > (max_cap - (value_to_add))))
|
||||
{
|
||||
return max_cap;
|
||||
|
|
Loading…
Reference in New Issue