From 10d42a2452e19ca98506df4d85c0e8f37b3e8981 Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Sun, 30 Jul 2017 12:53:21 -0500 Subject: Consolidated food effects into EatItem, added all fish type FoodInfos. (#3875) * Consolidated food effects into EatItem, added all fish types. * Changed type of NumFishInfos to satisfy clang. * Removed unused call for a_Item in EatItem --- src/Items/ItemGoldenApple.h | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/Items/ItemGoldenApple.h') diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h index c6bd7e470..a88d3eb54 100644 --- a/src/Items/ItemGoldenApple.h +++ b/src/Items/ItemGoldenApple.h @@ -20,9 +20,10 @@ public: virtual bool EatItem(cPlayer * a_Player, cItem * a_Item) override { - // Feed the player: - FoodInfo Info = GetFoodInfo(); - a_Player->Feed(Info.FoodLevel, Info.Saturation); + if (!super::EatItem(a_Player, a_Item)) + { + return false; + } // Add the effects: a_Player->AddEntityEffect(cEntityEffect::effAbsorption, 2400, 0); @@ -36,22 +37,16 @@ public: a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0); } - a_Player->GetInventory().RemoveOneEquippedItem(); return true; } - virtual FoodInfo GetFoodInfo(void) override + virtual FoodInfo GetFoodInfo(const cItem * a_Item) override { + UNUSED(a_Item); return FoodInfo(4, 9.6); } - - virtual bool GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_EffectDurationTicks, short & a_EffectIntensity, float & a_Chance) override - { - return false; - } - }; -- cgit v1.2.3