1
0

Use switch in GetStepSound

This commit is contained in:
Howaner 2014-02-28 22:32:10 +01:00
parent 27b98dec2b
commit 0274db0e14
2 changed files with 6 additions and 8 deletions

View File

@ -176,15 +176,13 @@ public:
virtual const char * GetStepSound(void) override
{
BLOCKTYPE Block = GetSingleSlabType(m_BlockType);
if (Block != m_BlockType)
switch (m_BlockType)
{
return cBlockHandler::GetBlockHandler(Block)->GetStepSound();
}
else
{
return "step.stone";
case E_BLOCK_DOUBLE_STONE_SLAB: return "step.stone";
case E_BLOCK_DOUBLE_WOODEN_SLAB: return "step.wood";
}
ASSERT(!"Unhandled double slab type!");
return "";
}
} ;

View File

@ -1043,7 +1043,7 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e
if (
cBlockSlabHandler::IsAnySlabType(ClickedBlock) && // Is there a slab already?
cBlockSlabHandler::IsAnySlabType(EquippedBlock) && // Is the player placing another slab?
((ClickedBlockMeta & 0x07) == EquippedBlockDamage) && // Is it the same slab type?
((ClickedBlockMeta & 0x07) == EquippedBlockDamage) && // Is it the same slab type?
(
(a_BlockFace == BLOCK_FACE_TOP) || // Clicking the top of a bottom slab
(a_BlockFace == BLOCK_FACE_BOTTOM) // Clicking the bottom of a top slab