diff options
Diffstat (limited to '')
-rw-r--r-- | src/Generating/MineShafts.cpp | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp index 755fa23a3..5a9fd6368 100644 --- a/src/Generating/MineShafts.cpp +++ b/src/Generating/MineShafts.cpp @@ -767,33 +767,30 @@ void cMineShaftCorridor::PlaceChest(cChunkDesc & a_ChunkDesc) int BlockZ = a_ChunkDesc.GetChunkZ() * cChunkDef::Width; int x, z; NIBBLETYPE Meta = 0; - switch (m_Direction) + [&] { - case dirXM: - case dirXP: + switch (m_Direction) { - x = m_BoundingBox.p1.x + m_ChestPosition - BlockX; - z = m_BoundingBox.p1.z - BlockZ; - Meta = E_META_CHEST_FACING_ZP; - break; - } + case dirXM: + case dirXP: + { + x = m_BoundingBox.p1.x + m_ChestPosition - BlockX; + z = m_BoundingBox.p1.z - BlockZ; + Meta = E_META_CHEST_FACING_ZP; + return; + } - case dirZM: - case dirZP: - { - x = m_BoundingBox.p1.x - BlockX; - z = m_BoundingBox.p1.z + m_ChestPosition - BlockZ; - Meta = E_META_CHEST_FACING_XP; - break; - } - #if !defined(__clang__) - default: - { - ASSERT(!"Unknown direction"); - return; - } - #endif - } // switch (Dir) + case dirZM: + case dirZP: + { + x = m_BoundingBox.p1.x - BlockX; + z = m_BoundingBox.p1.z + m_ChestPosition - BlockZ; + Meta = E_META_CHEST_FACING_XP; + return; + } + } // switch (Dir) + UNREACHABLE("Unsupported corridor direction"); + }(); if ( (x >= 0) && (x < cChunkDef::Width) && |