summaryrefslogtreecommitdiffstats
path: root/src/Defines.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-19 13:31:35 +0200
committerMattes D <github@xoft.cz>2014-07-19 13:31:35 +0200
commitc2aa7d78bfe45e6ca363cb831d5cd605bf1779fc (patch)
treea8de103269fb7ef98a726e51bf8fcdfd17702ab9 /src/Defines.h
parentMerge pull request #1224 from mc-server/fixes-potions (diff)
parentWorld.cpp: fixed not all enum fields being used in m_Dimension switch (diff)
downloadcuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.gz
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.bz2
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.lz
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.xz
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.tar.zst
cuberite-c2aa7d78bfe45e6ca363cb831d5cd605bf1779fc.zip
Diffstat (limited to 'src/Defines.h')
-rw-r--r--src/Defines.h13
1 files changed, 1 insertions, 12 deletions
diff --git a/src/Defines.h b/src/Defines.h
index f57e63c7f..f7c8d0fc5 100644
--- a/src/Defines.h
+++ b/src/Defines.h
@@ -470,18 +470,7 @@ inline void AddFaceDirection(int & a_BlockX, unsigned char & a_BlockY, int & a_B
{
int Y = a_BlockY;
AddFaceDirection(a_BlockX, Y, a_BlockZ, a_BlockFace, a_bInverse);
- if (Y < 0)
- {
- a_BlockY = 0;
- }
- else if (Y > 255)
- {
- a_BlockY = 255;
- }
- else
- {
- a_BlockY = (unsigned char)Y;
- }
+ a_BlockY = Clamp<unsigned char>(Y, 0, 255);
}