From 041bfd5860cd8ef51db42eb6fb4b50b45549feba Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 01:40:29 -0700 Subject: Fixed clamping issues --- src/Defines.h | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src/Defines.h') 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(Y, 0, 255); } -- cgit v1.2.3