summaryrefslogtreecommitdiffstats
path: root/src/Defines.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 13:02:23 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-20 13:02:23 +0200
commitd0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab (patch)
tree4f283dd99354a72bb8ba30da637b38adb5521b76 /src/Defines.h
parentProper comment for DropBlock() (diff)
parentNBTChunkSerializer.cpp: Added break after serializing the splash potion (diff)
downloadcuberite-d0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab.tar
cuberite-d0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab.tar.gz
cuberite-d0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab.tar.bz2
cuberite-d0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab.tar.lz
cuberite-d0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab.tar.xz
cuberite-d0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab.tar.zst
cuberite-d0e7b2f18b15afbc78adfdcf7d1b7b3511a0a6ab.zip
Diffstat (limited to 'src/Defines.h')
-rw-r--r--src/Defines.h18
1 files changed, 3 insertions, 15 deletions
diff --git a/src/Defines.h b/src/Defines.h
index 4fde6800a..2cdb9d96d 100644
--- a/src/Defines.h
+++ b/src/Defines.h
@@ -1,7 +1,6 @@
#pragma once
-#include "ChatColor.h"
#include <limits>
#include <cmath>
@@ -22,7 +21,7 @@ typedef std::vector<int> cSlotNums;
/// Experience Orb setup
enum
{
- //open to suggestion on naming convention here :)
+ // Open to suggestion on naming convention here :)
MAX_EXPERIENCE_ORB_SIZE = 2000
} ;
@@ -471,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);
}
@@ -512,7 +500,7 @@ inline void VectorToEuler(double a_X, double a_Y, double a_Z, double & a_Pan, do
}
else
{
- a_Pan = atan2(a_Z, a_X) * 180 / PI - 90;
+ a_Pan = atan2(a_Z, a_X) * 180 / PI - 90;
}
a_Pitch = atan2(a_Y, r) * 180 / PI;