summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorQUSpilPrgm <QUSpilPrgm@users.noreply.github.com>2016-06-04 14:16:35 +0200
committerQUSpilPrgm <QUSpilPrgm@users.noreply.github.com>2016-06-15 10:33:49 +0200
commit33cd7f4e75819d50f22ae61027373ebb331305b5 (patch)
treeb61d763a27e1986116c1a2f3b779bcf0bb1bd27b /src/BlockEntities
parentMerge pull request #3227 from cuberite/NormalizeVectorApi (diff)
downloadcuberite-33cd7f4e75819d50f22ae61027373ebb331305b5.tar
cuberite-33cd7f4e75819d50f22ae61027373ebb331305b5.tar.gz
cuberite-33cd7f4e75819d50f22ae61027373ebb331305b5.tar.bz2
cuberite-33cd7f4e75819d50f22ae61027373ebb331305b5.tar.lz
cuberite-33cd7f4e75819d50f22ae61027373ebb331305b5.tar.xz
cuberite-33cd7f4e75819d50f22ae61027373ebb331305b5.tar.zst
cuberite-33cd7f4e75819d50f22ae61027373ebb331305b5.zip
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/DispenserEntity.cpp2
-rw-r--r--src/BlockEntities/DropSpenserEntity.cpp6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp
index e03644a0f..d6fbafadf 100644
--- a/src/BlockEntities/DispenserEntity.cpp
+++ b/src/BlockEntities/DispenserEntity.cpp
@@ -283,7 +283,7 @@ UInt32 cDispenserEntity::SpawnProjectileFromDispenser(int a_BlockX, int a_BlockY
Vector3d cDispenserEntity::GetShootVector(NIBBLETYPE a_Meta)
{
- switch (a_Meta & 0x7)
+ switch (a_Meta & E_META_DROPSPENSER_FACING_MASK)
{
case E_META_DROPSPENSER_FACING_YP: return Vector3d( 0, 1, 0);
case E_META_DROPSPENSER_FACING_YM: return Vector3d( 0, -1, 0);
diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp
index 8dddf85de..3a43e1073 100644
--- a/src/BlockEntities/DropSpenserEntity.cpp
+++ b/src/BlockEntities/DropSpenserEntity.cpp
@@ -41,7 +41,7 @@ cDropSpenserEntity::~cDropSpenserEntity()
void cDropSpenserEntity::AddDropSpenserDir(int & a_BlockX, int & a_BlockY, int & a_BlockZ, NIBBLETYPE a_Direction)
{
- switch (a_Direction & 0x07) // Vanilla uses the 8th bit to determine power state - we don't
+ switch (a_Direction & E_META_DROPSPENSER_FACING_MASK)
{
case E_META_DROPSPENSER_FACING_YM: a_BlockY--; return;
case E_META_DROPSPENSER_FACING_YP: a_BlockY++; return;
@@ -87,7 +87,7 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk)
// Broadcast a smoke and click effects:
NIBBLETYPE Meta = a_Chunk.GetMeta(m_RelX, m_PosY, m_RelZ);
int SmokeDir = 0;
- switch (Meta)
+ switch (Meta & E_META_DROPSPENSER_FACING_MASK)
{
case E_META_DROPSPENSER_FACING_YP: SmokeDir = static_cast<int>(SmokeDirection::CENTRE); break; // YP & YM don't have associated smoke dirs, just do 4 (centre of block)
case E_META_DROPSPENSER_FACING_YM: SmokeDir = static_cast<int>(SmokeDirection::CENTRE); break;
@@ -176,7 +176,7 @@ void cDropSpenserEntity::DropFromSlot(cChunk & a_Chunk, int a_SlotNum)
const int PickupSpeed = m_World->GetTickRandomNumber(4) + 2; // At least 2, at most 6
int PickupSpeedX = 0, PickupSpeedY = 0, PickupSpeedZ = 0;
- switch (Meta)
+ switch (Meta & E_META_DROPSPENSER_FACING_MASK)
{
case E_META_DROPSPENSER_FACING_YP: PickupSpeedY = PickupSpeed; break;
case E_META_DROPSPENSER_FACING_YM: PickupSpeedY = -PickupSpeed; break;