From 83870f9fc0e19da646f408a2d6636adfe4b5c002 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Mon, 23 Nov 2015 23:39:19 +0000 Subject: Add enum for Sound and Particle Effects Fixes #2603 Signed-off-by: Dave Tucker --- src/BlockEntities/DropSpenserEntity.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/BlockEntities/DropSpenserEntity.cpp') diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp index 3a93e85a1..211bf8662 100644 --- a/src/BlockEntities/DropSpenserEntity.cpp +++ b/src/BlockEntities/DropSpenserEntity.cpp @@ -6,6 +6,7 @@ #include "Globals.h" #include "DropSpenserEntity.h" +#include "../EffectID.h" #include "../Entities/Player.h" #include "../Chunk.h" #include "../UI/DropSpenserWindow.h" @@ -89,14 +90,14 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk) int SmokeDir = 0; switch (Meta) { - case E_META_DROPSPENSER_FACING_YP: SmokeDir = 4; break; // YP & YM don't have associated smoke dirs, just do 4 (centre of block) - case E_META_DROPSPENSER_FACING_YM: SmokeDir = 4; break; - case E_META_DROPSPENSER_FACING_XM: SmokeDir = 3; break; - case E_META_DROPSPENSER_FACING_XP: SmokeDir = 5; break; - case E_META_DROPSPENSER_FACING_ZM: SmokeDir = 1; break; - case E_META_DROPSPENSER_FACING_ZP: SmokeDir = 7; break; + case E_META_DROPSPENSER_FACING_YP: SmokeDir = static_cast(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(SmokeDirection::CENTRE); break; + case E_META_DROPSPENSER_FACING_XM: SmokeDir = static_cast(SmokeDirection::EAST); break; + case E_META_DROPSPENSER_FACING_XP: SmokeDir = static_cast(SmokeDirection::WEST); break; + case E_META_DROPSPENSER_FACING_ZM: SmokeDir = static_cast(SmokeDirection::SOUTH); break; + case E_META_DROPSPENSER_FACING_ZP: SmokeDir = static_cast(SmokeDirection::NORTH); break; } - m_World->BroadcastSoundParticleEffect(2000, m_PosX, m_PosY, m_PosZ, SmokeDir); + m_World->BroadcastSoundParticleEffect(EffectID::PARTICLE_SMOKE, m_PosX, m_PosY, m_PosZ, SmokeDir); m_World->BroadcastSoundEffect("random.click", static_cast(m_PosX), static_cast(m_PosY), static_cast(m_PosZ), 1.0f, 1.0f); } -- cgit v1.2.3