From bdedab15c94956cbc74045ab242fd300d25f39e7 Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 9 Apr 2020 22:25:20 +0200 Subject: Falling blocks can now be spawned at any position. (#4620) * Falling blocks can now be spawned at any position. * Added a /cake command to Debuggers that throws a cake in a nice slow arc. * Fixed regular falling blocks. --- src/Entities/FallingBlock.cpp | 7 +++---- src/Entities/FallingBlock.h | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/FallingBlock.cpp b/src/Entities/FallingBlock.cpp index 628e4d34c..18cd3e086 100644 --- a/src/Entities/FallingBlock.cpp +++ b/src/Entities/FallingBlock.cpp @@ -11,11 +11,10 @@ -cFallingBlock::cFallingBlock(Vector3i a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) : - super(etFallingBlock, Vector3d(0.5, 0, 0.5) + a_BlockPosition, 0.98, 0.98), +cFallingBlock::cFallingBlock(Vector3d a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta): + super(etFallingBlock, a_Position, 0.98, 0.98), m_BlockType(a_BlockType), - m_BlockMeta(a_BlockMeta), - m_OriginalPosition(a_BlockPosition) + m_BlockMeta(a_BlockMeta) { SetGravity(-16.0f); SetAirDrag(0.02f); diff --git a/src/Entities/FallingBlock.h b/src/Entities/FallingBlock.h index e4e9582d8..dfac287fd 100644 --- a/src/Entities/FallingBlock.h +++ b/src/Entities/FallingBlock.h @@ -20,8 +20,8 @@ public: // tolua_export CLASS_PROTODEF(cFallingBlock) /** Creates a new falling block. - a_BlockPosition is expected in world coords */ - cFallingBlock(Vector3i a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); + a_Position is expected in world coords */ + cFallingBlock(Vector3d a_Position, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta); // tolua_begin @@ -37,7 +37,6 @@ public: // tolua_export private: BLOCKTYPE m_BlockType; NIBBLETYPE m_BlockMeta; - Vector3i m_OriginalPosition; // Position where the falling block has started, in world coords } ; // tolua_export -- cgit v1.2.3