summaryrefslogtreecommitdiffstats
path: root/source/FallingBlock.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-21 22:55:36 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-02-21 22:55:36 +0100
commit4ce0c5a983bbb82a0a8091ad735c6ec494c912e2 (patch)
treee87c7544799ce5fd0e54e50caf2b4d909f6e4ca9 /source/FallingBlock.cpp
parentAdded HOOK_EXECUTE_COMMAND for intercepting executed commands and console commands. (diff)
downloadcuberite-4ce0c5a983bbb82a0a8091ad735c6ec494c912e2.tar
cuberite-4ce0c5a983bbb82a0a8091ad735c6ec494c912e2.tar.gz
cuberite-4ce0c5a983bbb82a0a8091ad735c6ec494c912e2.tar.bz2
cuberite-4ce0c5a983bbb82a0a8091ad735c6ec494c912e2.tar.lz
cuberite-4ce0c5a983bbb82a0a8091ad735c6ec494c912e2.tar.xz
cuberite-4ce0c5a983bbb82a0a8091ad735c6ec494c912e2.tar.zst
cuberite-4ce0c5a983bbb82a0a8091ad735c6ec494c912e2.zip
Diffstat (limited to 'source/FallingBlock.cpp')
-rw-r--r--source/FallingBlock.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/source/FallingBlock.cpp b/source/FallingBlock.cpp
index 7b0fa69fb..8f0320d9b 100644
--- a/source/FallingBlock.cpp
+++ b/source/FallingBlock.cpp
@@ -9,10 +9,9 @@
cFallingBlock::cFallingBlock(const Vector3i & a_BlockPosition, BLOCKTYPE a_BlockType)
- : super(etFallingBlock, a_BlockPosition.x + 0.5f, a_BlockPosition.y + 0.5f, a_BlockPosition.z + 0.5f )
- , m_BlockType( a_BlockType )
- , m_OriginalPosition( a_BlockPosition )
- , m_SpeedY( 0 )
+ : super(etFallingBlock, a_BlockPosition.x + 0.5f, a_BlockPosition.y + 0.5f, a_BlockPosition.z + 0.5f)
+ , m_BlockType(a_BlockType)
+ , m_OriginalPosition(a_BlockPosition)
{
}
@@ -42,16 +41,16 @@ void cFallingBlock::SpawnOn(cClientHandle & a_ClientHandle)
void cFallingBlock::Tick(float a_Dt, MTRand & a_TickRandom)
{
float MilliDt = a_Dt * 0.001f;
- m_SpeedY -= MilliDt * 9.8f;
- m_Pos.y += m_SpeedY * MilliDt;
+ m_Speed.y -= MilliDt * 9.8f;
+ m_Pos.y += m_Speed.y * MilliDt;
- //GetWorld()->BroadcastTeleportEntity(*this); // Testing position
+ // GetWorld()->BroadcastTeleportEntity(*this); // Testing position
- Vector3i BlockPos( m_OriginalPosition.x, (int)(m_Pos.y - 0.5), m_OriginalPosition.z );
+ Vector3i BlockPos( m_OriginalPosition.x, (int)(m_Pos.y - 0.5), m_OriginalPosition.z);
if (!IsPassable(GetWorld()->GetBlock(BlockPos)))
{
Destroy();
- GetWorld()->SetBlock( BlockPos.x, BlockPos.y + 1, BlockPos.z, m_BlockType, 0 );
+ GetWorld()->SetBlock(BlockPos.x, BlockPos.y + 1, BlockPos.z, m_BlockType, 0);
}
}