diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-02-04 20:26:39 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-02-04 20:26:39 +0100 |
commit | 1f26c9f5ab478b072eac7e850e730d5f0095c7dd (patch) | |
tree | a008d194f4fb90e2682b6a26310e5a5429427d3f /src | |
parent | Ensure -Wall is enabled (diff) | |
download | cuberite-1f26c9f5ab478b072eac7e850e730d5f0095c7dd.tar cuberite-1f26c9f5ab478b072eac7e850e730d5f0095c7dd.tar.gz cuberite-1f26c9f5ab478b072eac7e850e730d5f0095c7dd.tar.bz2 cuberite-1f26c9f5ab478b072eac7e850e730d5f0095c7dd.tar.lz cuberite-1f26c9f5ab478b072eac7e850e730d5f0095c7dd.tar.xz cuberite-1f26c9f5ab478b072eac7e850e730d5f0095c7dd.tar.zst cuberite-1f26c9f5ab478b072eac7e850e730d5f0095c7dd.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Blocks/BlockTorch.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Blocks/BlockTorch.h b/src/Blocks/BlockTorch.h index 13f961d21..f2a4c8665 100644 --- a/src/Blocks/BlockTorch.h +++ b/src/Blocks/BlockTorch.h @@ -113,9 +113,10 @@ public: /// Finds a suitable face to place the torch, returning BLOCK_FACE_NONE on failure static eBlockFace FindSuitableFace(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ) { - for (eBlockFace i = BLOCK_FACE_YM; i <= BLOCK_FACE_XP; i++) // Loop through all directions + for (int i = BLOCK_FACE_YM; i <= BLOCK_FACE_XP; i++) // Loop through all directions { - AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, i, true); + eBlockFace Face = static_cast<eBlockFace>(i); + AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, Face, true); BLOCKTYPE BlockInQuestion = a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ); if ( // If on a block that can only hold a torch if torch is standing on it, return that face @@ -123,20 +124,20 @@ public: (BlockInQuestion == E_BLOCK_FENCE) || (BlockInQuestion == E_BLOCK_NETHER_BRICK_FENCE) || (BlockInQuestion == E_BLOCK_COBBLESTONE_WALL)) && - (i == BLOCK_FACE_TOP) + (Face == BLOCK_FACE_TOP) ) { - return i; + return Face; } else if ((g_BlockFullyOccupiesVoxel[BlockInQuestion]) && (i != BLOCK_FACE_BOTTOM)) { // Otherwise, if block in that direction is torch placeable and we haven't gotten to it via the bottom face, return that face - return i; + return Face; } else { // Reset coords in preparation for next iteration - AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, i, false); + AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, Face, false); } } return BLOCK_FACE_NONE; |