From d3a3c6ad2cafd95363f47f7d370a45425525fa35 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Tue, 23 Jan 2018 22:07:06 +0100 Subject: Removed cBlockInfo.m_IsSnowable (#4105) * Removed cBlockInfo.m_IsSnowable * Return IsSnowable from deprecated variable binding m_IsSnowable. --- src/BlockInfo.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/BlockInfo.h') 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 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: -- cgit v1.2.3