File tree 2 files changed +4
-2
lines changed
2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -77,4 +77,5 @@ using qboolean = int;
77
77
#define V_min (a, b ) (((a) < (b)) ? (a) : (b))
78
78
#define V_max (a, b ) (((a) > (b)) ? (a) : (b))
79
79
80
- #define clamp (val, min, max ) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
80
+ // Clamp macro is deprecated. Use std::clamp instead.
81
+ // #define clamp(val, min, max) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val)))
Original file line number Diff line number Diff line change 21
21
*/
22
22
23
23
#include < limits>
24
+ #include < algorithm>
24
25
25
26
#include " extdll.h"
26
27
#include " util.h"
@@ -3904,7 +3905,7 @@ void CBasePlayer::UpdateClientData()
3904
3905
3905
3906
if (pev->health != m_iClientHealth)
3906
3907
{
3907
- int iHealth = clamp (pev->health , 0 , std::numeric_limits<short >::max ()); // make sure that no negative health values are sent
3908
+ int iHealth = std:: clamp< float > (pev->health , 0 . f , ( float )( std::numeric_limits<short >::max () )); // make sure that no negative health values are sent
3908
3909
if (pev->health > 0 .0f && pev->health <= 1 .0f )
3909
3910
iHealth = 1 ;
3910
3911
You can’t perform that action at this time.
0 commit comments