diff options
Diffstat (limited to 'src/BlockEntities')
-rw-r--r-- | src/BlockEntities/BlockEntity.cpp | 18 | ||||
-rw-r--r-- | src/BlockEntities/CMakeLists.txt | 4 |
2 files changed, 12 insertions, 10 deletions
diff --git a/src/BlockEntities/BlockEntity.cpp b/src/BlockEntities/BlockEntity.cpp index f2380734a..b83c5319f 100644 --- a/src/BlockEntities/BlockEntity.cpp +++ b/src/BlockEntities/BlockEntity.cpp @@ -64,8 +64,11 @@ bool cBlockEntity::IsBlockEntityBlockType(BLOCKTYPE a_BlockType) { return true; } + default: + { + return false; + } } - return false; } @@ -95,12 +98,15 @@ cBlockEntity * cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE case E_BLOCK_SIGN_POST: return new cSignEntity (a_BlockType, a_BlockMeta, a_BlockX, a_BlockY, a_BlockZ, a_World); case E_BLOCK_TRAPPED_CHEST: return new cChestEntity (a_BlockType, a_BlockMeta, a_BlockX, a_BlockY, a_BlockZ, a_World); case E_BLOCK_WALLSIGN: return new cSignEntity (a_BlockType, a_BlockMeta, a_BlockX, a_BlockY, a_BlockZ, a_World); + default: + { + LOGD("%s: Requesting creation of an unknown block entity - block type %d (%s)", + __FUNCTION__, a_BlockType, ItemTypeToString(a_BlockType).c_str() + ); + ASSERT(!"Requesting creation of an unknown block entity"); + return nullptr; + } } - LOGD("%s: Requesting creation of an unknown block entity - block type %d (%s)", - __FUNCTION__, a_BlockType, ItemTypeToString(a_BlockType).c_str() - ); - ASSERT(!"Requesting creation of an unknown block entity"); - return nullptr; } diff --git a/src/BlockEntities/CMakeLists.txt b/src/BlockEntities/CMakeLists.txt index 93033931c..d512a776c 100644 --- a/src/BlockEntities/CMakeLists.txt +++ b/src/BlockEntities/CMakeLists.txt @@ -46,10 +46,6 @@ SET (HDRS SignEntity.h ) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set_source_files_properties(BeaconEntity.cpp PROPERTIES COMPILE_FLAGS "-Wno-error=switch-enum") -endif() - if(NOT MSVC) add_library(BlockEntities ${SRCS} ${HDRS}) endif() |