diff options
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockLadder.h | 5 | ||||
-rw-r--r-- | src/Blocks/ClearMetaOnDrop.h | 18 |
2 files changed, 21 insertions, 2 deletions
diff --git a/src/Blocks/BlockLadder.h b/src/Blocks/BlockLadder.h index a605edf3f..1af2be067 100644 --- a/src/Blocks/BlockLadder.h +++ b/src/Blocks/BlockLadder.h @@ -3,17 +3,18 @@ #include "BlockHandler.h" #include "../World.h" +#include "ClearMetaOnDrop.h" class cBlockLadderHandler : - public cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04> + public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04> > { public: cBlockLadderHandler(BLOCKTYPE a_BlockType) - : cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04>(a_BlockType) + : cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04> >(a_BlockType) { } diff --git a/src/Blocks/ClearMetaOnDrop.h b/src/Blocks/ClearMetaOnDrop.h new file mode 100644 index 000000000..21b987f2c --- /dev/null +++ b/src/Blocks/ClearMetaOnDrop.h @@ -0,0 +1,18 @@ + +#pragma once + +template<class Base> +class cClearMetaOnDrop : public Base +{ +public: + + cClearMetaOnDrop(BLOCKTYPE a_BlockType) : + Base(a_BlockType) + {} + + virtual ~cClearMetaOnDrop() {} + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(this->m_BlockType, 1, 0)); + } +}; |