diff options
Diffstat (limited to 'src/BlockInfo.cpp')
-rw-r--r-- | src/BlockInfo.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp index 78ae4c24c..41c8536a7 100644 --- a/src/BlockInfo.cpp +++ b/src/BlockInfo.cpp @@ -414,8 +414,7 @@ cBlockInfo::cBlockInfo(): m_FullyOccupiesVoxel(false), m_CanBeTerraformed(false), m_BlockHeight(1.0), - m_Hardness(0.0f), - m_Handler() + m_Hardness(0.0f) { } @@ -423,13 +422,9 @@ cBlockInfo::cBlockInfo(): -bool cBlockInfo::IsSnowable(BLOCKTYPE a_BlockType) +cBlockHandler * cBlockInfo::GetHandler(BLOCKTYPE a_Type) { - return ( - (a_BlockType == E_BLOCK_ICE) || - (a_BlockType == E_BLOCK_LEAVES) || - (!IsTransparent(a_BlockType) && (a_BlockType != E_BLOCK_PACKED_ICE)) - ); + return &cBlockHandler::GetBlockHandler(a_Type); } @@ -557,9 +552,13 @@ float cBlockInfo::GetExplosionAbsorption(const BLOCKTYPE Block) -void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler) +bool cBlockInfo::IsSnowable(BLOCKTYPE a_BlockType) { - delete a_Handler; + return ( + (a_BlockType == E_BLOCK_ICE) || + (a_BlockType == E_BLOCK_LEAVES) || + (!IsTransparent(a_BlockType) && (a_BlockType != E_BLOCK_PACKED_ICE)) + ); } @@ -573,7 +572,6 @@ cBlockInfo::cBlockInfoArray::cBlockInfoArray() for (size_t i = 0; i < Info.size(); ++i) { Info[i].m_BlockType = static_cast<BLOCKTYPE>(i); - Info[i].m_Handler.reset(cBlockHandler::CreateBlockHandler(Info[i].m_BlockType)); } // Emissive blocks |