From 2973b179777e9a78b4aaf7c10e6b82d3af317fa4 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 14 Sep 2013 08:16:39 +0200 Subject: Fixed empty-handed itemhandler. This should fix FS 430. --- source/Items/ItemHandler.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/Items/ItemHandler.cpp') diff --git a/source/Items/ItemHandler.cpp b/source/Items/ItemHandler.cpp index 374d0ebf5..08a7b661d 100644 --- a/source/Items/ItemHandler.cpp +++ b/source/Items/ItemHandler.cpp @@ -54,7 +54,11 @@ cItemHandler * cItemHandler::GetItemHandler(int a_ItemType) { if (a_ItemType < 0) { - ASSERT(!"Bad item type"); + // Either nothing (-1), or bad value, both cases should return the air handler + if (a_ItemType < -1) + { + ASSERT(!"Bad item type"); + } a_ItemType = 0; } @@ -86,6 +90,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_BLOCK_SAPLING: return new cItemSaplingHandler(a_ItemType); case E_BLOCK_WOOL: return new cItemClothHandler(a_ItemType); case E_ITEM_BED: return new cItemBedHandler(a_ItemType); + case E_ITEM_BOAT: return new cItemBoatHandler(a_ItemType); case E_ITEM_BOW: return new cItemBowHandler; case E_ITEM_BREWING_STAND: return new cItemBrewingStandHandler(a_ItemType); case E_ITEM_CAULDRON: return new cItemCauldronHandler(a_ItemType); @@ -181,11 +186,6 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) return new cItemMinecartHandler(a_ItemType); } - case E_ITEM_BOAT: - { - return new cItemBoatHandler(a_ItemType); - } - // Food: case E_ITEM_BREAD: case E_ITEM_COOKIE: -- cgit v1.2.3