summaryrefslogtreecommitdiffstats
path: root/source/Player.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-01 20:05:41 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-01 20:05:41 +0200
commit1406d80b2b8410b1d31d75d07430433915440a42 (patch)
treed0b54c1d27ae60376808eb84864207cfec1acf36 /source/Player.cpp
parentListenThread: Fixed socket-querying, might have crashed some linux versions. (diff)
downloadcuberite-1406d80b2b8410b1d31d75d07430433915440a42.tar
cuberite-1406d80b2b8410b1d31d75d07430433915440a42.tar.gz
cuberite-1406d80b2b8410b1d31d75d07430433915440a42.tar.bz2
cuberite-1406d80b2b8410b1d31d75d07430433915440a42.tar.lz
cuberite-1406d80b2b8410b1d31d75d07430433915440a42.tar.xz
cuberite-1406d80b2b8410b1d31d75d07430433915440a42.tar.zst
cuberite-1406d80b2b8410b1d31d75d07430433915440a42.zip
Diffstat (limited to 'source/Player.cpp')
-rw-r--r--source/Player.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/source/Player.cpp b/source/Player.cpp
index d20db5067..a96967360 100644
--- a/source/Player.cpp
+++ b/source/Player.cpp
@@ -267,18 +267,29 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
if (!m_bTouchGround)
{
- if(GetPosY() > m_LastJumpHeight) m_LastJumpHeight = (float)GetPosY();
- cWorld* World = GetWorld();
- char BlockID = World->GetBlock( float2int(GetPosX()), float2int(GetPosY()), float2int(GetPosZ()) );
- if( BlockID != E_BLOCK_AIR )
+ if (GetPosY() > m_LastJumpHeight)
{
- // LOGD("TouchGround set to true by server");
- m_bTouchGround = true;
+ m_LastJumpHeight = (float)GetPosY();
}
- if( BlockID == E_BLOCK_WATER || BlockID == E_BLOCK_STATIONARY_WATER || BlockID == E_BLOCK_LADDER || BlockID == E_BLOCK_VINES )
+ cWorld * World = GetWorld();
+ if ((GetPosY() >= 0) && (GetPosY() < 256))
{
- // LOGD("Water / Ladder / Torch");
- m_LastGroundHeight = (float)GetPosY();
+ BLOCKTYPE BlockType = World->GetBlock( float2int(GetPosX()), float2int(GetPosY()), float2int(GetPosZ()) );
+ if (BlockType != E_BLOCK_AIR)
+ {
+ // LOGD("TouchGround set to true by server");
+ m_bTouchGround = true;
+ }
+ if (
+ (BlockType == E_BLOCK_WATER) ||
+ (BlockType == E_BLOCK_STATIONARY_WATER) ||
+ (BlockType == E_BLOCK_LADDER) ||
+ (BlockType == E_BLOCK_VINES)
+ )
+ {
+ // LOGD("Water / Ladder / Torch");
+ m_LastGroundHeight = (float)GetPosY();
+ }
}
}