diff options
Diffstat (limited to 'src/BlockInfo.h')
-rw-r--r-- | src/BlockInfo.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/BlockInfo.h b/src/BlockInfo.h index e7544bf2d..e8bf9142e 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -43,9 +43,6 @@ public: /** Does this block disperse sky light? (only relevant for transparent blocks) */ bool m_IsSkylightDispersant; - /** Can this block hold snow atop? */ - bool m_IsSnowable; - /** Is this block solid (player cannot walk through)? */ bool m_IsSolid; @@ -75,6 +72,9 @@ public: /** Associated block handler. */ std::unique_ptr<cBlockHandler, sHandlerDeleter> m_Handler; + /** The block type associated with this cBlockInfo. Needed for DeprecatedBindings.cpp */ + BLOCKTYPE m_BlockType; + // tolua_begin inline static NIBBLETYPE GetLightValue (BLOCKTYPE a_Type) { return Get(a_Type).m_LightValue; } @@ -87,7 +87,14 @@ public: { return ((Get(a_Type).m_IsSkylightDispersant) || (Get(a_Type).m_SpreadLightFalloff > 1)); } - inline static bool IsSnowable (BLOCKTYPE a_Type) { return Get(a_Type).m_IsSnowable; } + inline static bool IsSnowable (BLOCKTYPE a_Type) + { + return ( + (a_Type == E_BLOCK_ICE) + || (a_Type == E_BLOCK_LEAVES) + || (!Get(a_Type).m_Transparent && (a_Type != E_BLOCK_PACKED_ICE)) + ); + } inline static bool IsSolid (BLOCKTYPE a_Type) { return Get(a_Type).m_IsSolid; } inline static bool IsUseableBySpectator (BLOCKTYPE a_Type) { return Get(a_Type).m_UseableBySpectator; } inline static bool FullyOccupiesVoxel (BLOCKTYPE a_Type) { return Get(a_Type).m_FullyOccupiesVoxel; } @@ -108,7 +115,6 @@ public: , m_PistonBreakable(false) , m_IsRainBlocker(false) , m_IsSkylightDispersant(false) - , m_IsSnowable(false) , m_IsSolid(true) , m_UseableBySpectator(false) , m_FullyOccupiesVoxel(false) @@ -116,6 +122,7 @@ public: , m_BlockHeight(1.0) , m_Hardness(0.0f) , m_Handler() + , m_BlockType(E_BLOCK_AIR) {} private: |