diff options
author | peterbell10 <peterbell10@live.co.uk> | 2018-02-05 00:07:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-05 00:07:12 +0100 |
commit | d3c1c626f569e5aa58085425924cca45927b6199 (patch) | |
tree | c65dee850358467c9afebdd37fcd4f6fb95a475a /src/Generating/MineShafts.cpp | |
parent | cChunk and cChunkData: Use vectors for block get and set functions (#4172) (diff) | |
download | cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.gz cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.bz2 cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.lz cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.xz cuberite-d3c1c626f569e5aa58085425924cca45927b6199.tar.zst cuberite-d3c1c626f569e5aa58085425924cca45927b6199.zip |
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) && |