summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-25 20:02:13 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-25 20:02:13 +0100
commit7468ba0f107ed01275f346c87ff5bb265dbbff3d (patch)
tree5c1c2563b5e95bfbfb999dee891150b99369f926 /src/Entities/Player.cpp
parentAttack() is no longer always called (diff)
downloadcuberite-7468ba0f107ed01275f346c87ff5bb265dbbff3d.tar
cuberite-7468ba0f107ed01275f346c87ff5bb265dbbff3d.tar.gz
cuberite-7468ba0f107ed01275f346c87ff5bb265dbbff3d.tar.bz2
cuberite-7468ba0f107ed01275f346c87ff5bb265dbbff3d.tar.lz
cuberite-7468ba0f107ed01275f346c87ff5bb265dbbff3d.tar.xz
cuberite-7468ba0f107ed01275f346c87ff5bb265dbbff3d.tar.zst
cuberite-7468ba0f107ed01275f346c87ff5bb265dbbff3d.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 2a5baedb6..71e304967 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -26,8 +26,6 @@
#include "inifile/iniFile.h"
#include "json/json.h"
-#define float2int(x) ((x)<0 ? ((int)(x))-1 : (int)(x))
-
@@ -440,7 +438,7 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
cWorld * World = GetWorld();
if ((GetPosY() >= 0) && (GetPosY() < cChunkDef::Height))
{
- BLOCKTYPE BlockType = World->GetBlock(float2int(GetPosX()), float2int(GetPosY()), float2int(GetPosZ()));
+ BLOCKTYPE BlockType = World->GetBlock((int)floor(GetPosX()), (int)floor(GetPosY()), (int)floor(GetPosZ()));
if (BlockType != E_BLOCK_AIR)
{
m_bTouchGround = true;
@@ -470,7 +468,7 @@ void cPlayer::SetTouchGround(bool a_bTouchGround)
TakeDamage(dtFalling, NULL, Damage, Damage, 0);
}
- // Mojang uses floor() to get X and Z positions, instead of just casting it to an (int)
+ // Fall particles
GetWorld()->BroadcastSoundParticleEffect(2006, (int)floor(GetPosX()), (int)GetPosY() - 1, (int)floor(GetPosZ()), Damage /* Used as particle effect speed modifier */);
}