summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2018-01-06 01:39:23 +0100
committerpeterbell10 <peterbell10@live.co.uk>2018-01-06 01:39:23 +0100
commit2529a898351c4b7c6372570ba53a7e25678980a9 (patch)
treef87099d4a2374bb67fad1aa35ed472eb0af05ddf /src/Items/ItemHandler.cpp
parentImproved fishing rewards (#4120) (diff)
downloadcuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.gz
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.bz2
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.lz
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.xz
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.tar.zst
cuberite-2529a898351c4b7c6372570ba53a7e25678980a9.zip
Diffstat (limited to '')
-rw-r--r--src/Items/ItemHandler.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 976ab959d..14b25d2b7 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -822,17 +822,8 @@ bool cItemHandler::GetPlacementBlockTypeMeta(
bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item)
{
- if (!a_Player->IsGameModeCreative())
- {
- a_Player->GetInventory().RemoveOneEquippedItem();
- }
-
- FoodInfo Info = GetFoodInfo(a_Item);
- if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f))
- {
- return a_Player->Feed(Info.FoodLevel, Info.Saturation);
- }
- return false;
+ auto FoodInfo = GetFoodInfo(a_Item);
+ return a_Player->Feed(FoodInfo.FoodLevel, FoodInfo.Saturation);
}