summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorandrew <xdotftw@gmail.com>2014-02-20 15:38:37 +0100
committerandrew <xdotftw@gmail.com>2014-02-20 15:38:37 +0100
commitf201f4f176fc908e9ddebfed86d4c8ef5582556c (patch)
tree9cb6601cc1eeeab979c088faa66be52fe27e086e /src/Globals.h
parentManual merge (Fixed conflicts) (diff)
downloadcuberite-f201f4f176fc908e9ddebfed86d4c8ef5582556c.tar
cuberite-f201f4f176fc908e9ddebfed86d4c8ef5582556c.tar.gz
cuberite-f201f4f176fc908e9ddebfed86d4c8ef5582556c.tar.bz2
cuberite-f201f4f176fc908e9ddebfed86d4c8ef5582556c.tar.lz
cuberite-f201f4f176fc908e9ddebfed86d4c8ef5582556c.tar.xz
cuberite-f201f4f176fc908e9ddebfed86d4c8ef5582556c.tar.zst
cuberite-f201f4f176fc908e9ddebfed86d4c8ef5582556c.zip
Diffstat (limited to '')
-rw-r--r--src/Globals.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 7ee045130..e4737a98a 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -235,11 +235,11 @@ public:
-/** Clamp a_X to the specified range. */
+/** Clamp X to the specified range. */
template <typename T>
-T Clamp(T a_X, T a_Min, T a_Max)
+T Clamp(T a_Value, T a_Min, T a_Max)
{
- return std::min(std::max(a_X, a_Min), a_Max);
+ return (a_Value < a_Min) ? a_Min : ((a_Value > a_Max) ? a_Max : a_Value);
}