summaryrefslogtreecommitdiffstats
path: root/source/ClientHandle.cpp
diff options
context:
space:
mode:
authorJames Ravenscroft <ravenscroftj@gmail.com>2013-08-09 09:37:39 +0200
committerJames Ravenscroft <ravenscroftj@gmail.com>2013-08-09 09:37:39 +0200
commitdace1f7bd2e661b4c771322162e9e1b52551dd56 (patch)
tree9565683fe1b72633336954a49247d9fd6af9931f /source/ClientHandle.cpp
parentFixed the jump food exhaustion being added when player is swimming (diff)
downloadcuberite-dace1f7bd2e661b4c771322162e9e1b52551dd56.tar
cuberite-dace1f7bd2e661b4c771322162e9e1b52551dd56.tar.gz
cuberite-dace1f7bd2e661b4c771322162e9e1b52551dd56.tar.bz2
cuberite-dace1f7bd2e661b4c771322162e9e1b52551dd56.tar.lz
cuberite-dace1f7bd2e661b4c771322162e9e1b52551dd56.tar.xz
cuberite-dace1f7bd2e661b4c771322162e9e1b52551dd56.tar.zst
cuberite-dace1f7bd2e661b4c771322162e9e1b52551dd56.zip
Diffstat (limited to '')
-rw-r--r--source/ClientHandle.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index 328e7de70..6df0cfa48 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -32,7 +32,6 @@
#include "Protocol/ProtocolRecognizer.h"
-#define float2int(x) ((x)<0 ? ((int)(x))-1 : (int)(x))
#define AddPistonDir(x, y, z, dir, amount) switch (dir) { case 0: (y)-=(amount); break; case 1: (y)+=(amount); break;\
@@ -505,9 +504,8 @@ void cClientHandle::HandlePlayerPos(double a_PosX, double a_PosY, double a_PosZ,
if ((a_PosY > m_Player->GetPosY()) && !a_IsOnGround && m_Player->IsOnGround())
{
// we only add this exhaustion if the player is not swimming - otherwise we end up with both jump + swim exhaustion
- cWorld * World = m_Player->GetWorld();
- BLOCKTYPE BlockType = World->GetBlock( float2int(m_Player->GetPosX()), float2int(m_Player->GetPosY()), float2int(m_Player->GetPosZ()) );
- if(! IsBlockWater(BlockType) )
+
+ if(! m_Player->IsSwimming() )
{
m_Player->AddFoodExhaustion(m_Player->IsSprinting() ? 0.8 : 0.2);
}