diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/Items/ItemFood.h | 1 | ||||
-rw-r--r-- | source/Items/ItemHandler.cpp | 1 | ||||
-rw-r--r-- | source/Player.cpp | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/source/Items/ItemFood.h b/source/Items/ItemFood.h index 6434f3dc7..2ae572331 100644 --- a/source/Items/ItemFood.h +++ b/source/Items/ItemFood.h @@ -50,6 +50,7 @@ public: case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8, 80); case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2, 100); case E_ITEM_STEAK: return FoodInfo(8, 12.8); + case E_ITEM_MUSHROOM_SOUP: return FoodInfo(6, 7.2); } LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType); return FoodInfo(0, 0.f); diff --git a/source/Items/ItemHandler.cpp b/source/Items/ItemHandler.cpp index c81916f5f..f3f4ac6e7 100644 --- a/source/Items/ItemHandler.cpp +++ b/source/Items/ItemHandler.cpp @@ -181,6 +181,7 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_RED_APPLE: case E_ITEM_GOLDEN_APPLE: case E_ITEM_ROTTEN_FLESH: + case E_ITEM_MUSHROOM_SOUP: case E_ITEM_SPIDER_EYE: { return new cItemFoodHandler(a_ItemType); diff --git a/source/Player.cpp b/source/Player.cpp index fb752ed87..6219523cf 100644 --- a/source/Player.cpp +++ b/source/Player.cpp @@ -400,7 +400,14 @@ void cPlayer::FinishEating(void) return; } ItemHandler->OnFoodEaten(m_World, this, &Item); + GetInventory().RemoveOneEquippedItem(); + + //if the food is mushroom soup, return a bowl to the inventory + if( Item.m_ItemType == E_ITEM_MUSHROOM_SOUP ) { + cItem emptyBowl(E_ITEM_BOWL, 1, 0, ""); + GetInventory().AddItem(emptyBowl, true, true); + } } |