From 30f9a4d3abf9cf7f2b7b9f38d46bbb497e8f6b93 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Sat, 27 Sep 2014 14:19:45 +0200 Subject: Fixed convertToPickups for doors --- src/Blocks/BlockDoor.h | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index b2f9e4dcd..af6eee290 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -55,7 +55,44 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { - a_Pickups.push_back(cItem((m_BlockType == E_BLOCK_WOODEN_DOOR) ? E_ITEM_WOODEN_DOOR : E_ITEM_IRON_DOOR, 1, 0)); + switch (m_BlockType) + { + case E_BLOCK_WOODEN_DOOR: + { + a_Pickups.Add(E_ITEM_WOODEN_DOOR); + break; + } + case E_BLOCK_ACACIA_DOOR: + { + a_Pickups.Add(E_ITEM_ACACIA_DOOR); + break; + } + case E_BLOCK_BIRCH_DOOR: + { + a_Pickups.Add(E_ITEM_BIRCH_DOOR); + break; + } + case E_BLOCK_DARK_OAK_DOOR: + { + a_Pickups.Add(E_ITEM_DARK_OAK_DOOR); + break; + } + case E_BLOCK_JUNGLE_DOOR: + { + a_Pickups.Add(E_ITEM_JUNGLE_DOOR); + break; + } + case E_BLOCK_SPRUCE_DOOR: + { + a_Pickups.Add(E_ITEM_SPRUCE_DOOR); + break; + } + case E_BLOCK_IRON_DOOR: + { + a_Pickups.Add(E_ITEM_IRON_DOOR); + break; + } + } } -- cgit v1.2.3 From 6dd47e783af33cc7eecaf1837899c213bc09f954 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Sat, 27 Sep 2014 15:11:35 +0200 Subject: Added default value to switch and spruce gate to fence gate handler --- src/Blocks/BlockDoor.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Blocks/BlockDoor.h') diff --git a/src/Blocks/BlockDoor.h b/src/Blocks/BlockDoor.h index af6eee290..0ff8bcfc8 100644 --- a/src/Blocks/BlockDoor.h +++ b/src/Blocks/BlockDoor.h @@ -92,6 +92,11 @@ public: a_Pickups.Add(E_ITEM_IRON_DOOR); break; } + default: + { + ASSERT(!"Unhandled door type!"); + break; + } } } -- cgit v1.2.3