summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/Entities/Player.cpp6
-rw-r--r--src/Items/ItemGoldenApple.h1
-rw-r--r--src/Items/ItemHandler.cpp1
-rw-r--r--src/Items/ItemMilk.h8
-rw-r--r--src/Items/ItemPotion.h8
5 files changed, 16 insertions, 8 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index b0dd40615..5e0da3298 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -627,13 +627,11 @@ void cPlayer::FinishEating(void)
}
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);
- GetInventory().AddItem(EmptyBowl, true, true);
+ GetInventory().RemoveOneEquippedItem();
+ GetInventory().AddItem(cItem(E_ITEM_BOWL), true, true);
}
}
diff --git a/src/Items/ItemGoldenApple.h b/src/Items/ItemGoldenApple.h
index 02ac0202c..5f6f1de6c 100644
--- a/src/Items/ItemGoldenApple.h
+++ b/src/Items/ItemGoldenApple.h
@@ -36,6 +36,7 @@ public:
a_Player->AddEntityEffect(cEntityEffect::effFireResistance, 6000, 0);
}
+ a_Player->GetInventory().RemoveOneEquippedItem();
return true;
}
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index bceedaf69..ca0f04dcc 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -632,6 +632,7 @@ bool cItemHandler::GetEatEffect(cEntityEffect::eType & a_EffectType, int & a_Eff
bool cItemHandler::EatItem(cPlayer * a_Player, cItem * a_Item)
{
UNUSED(a_Item);
+ a_Player->GetInventory().RemoveOneEquippedItem();
FoodInfo Info = GetFoodInfo();
if ((Info.FoodLevel > 0) || (Info.Saturation > 0.f))
diff --git a/src/Items/ItemMilk.h b/src/Items/ItemMilk.h
index db7bc13be..c9a90865a 100644
--- a/src/Items/ItemMilk.h
+++ b/src/Items/ItemMilk.h
@@ -21,8 +21,12 @@ public:
{
UNUSED(a_Item);
a_Player->ClearEntityEffects();
- a_Player->GetInventory().RemoveOneEquippedItem();
- a_Player->GetInventory().AddItem(E_ITEM_BUCKET);
+
+ if (!a_Player->IsGameModeCreative())
+ {
+ a_Player->GetInventory().RemoveOneEquippedItem();
+ a_Player->GetInventory().AddItem(E_ITEM_BUCKET);
+ }
return true;
}
};
diff --git a/src/Items/ItemPotion.h b/src/Items/ItemPotion.h
index 24614cd8a..398ef6805 100644
--- a/src/Items/ItemPotion.h
+++ b/src/Items/ItemPotion.h
@@ -68,8 +68,12 @@ public:
cEntityEffect::GetPotionEffectDuration(PotionDamage),
cEntityEffect::GetPotionEffectIntensity(PotionDamage)
);
- a_Player->GetInventory().RemoveOneEquippedItem();
- a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE);
+
+ if (!a_Player->IsGameModeCreative())
+ {
+ a_Player->GetInventory().RemoveOneEquippedItem();
+ a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE);
+ }
return true;
}
};