summaryrefslogtreecommitdiffstats
path: root/src/Items
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items')
-rw-r--r--src/Items/ItemBottle.h3
-rw-r--r--src/Items/ItemBucket.h3
-rw-r--r--src/Items/ItemFood.h5
-rw-r--r--src/Items/ItemMilk.h2
-rw-r--r--src/Items/ItemPotion.h2
5 files changed, 9 insertions, 6 deletions
diff --git a/src/Items/ItemBottle.h b/src/Items/ItemBottle.h
index 092d5d81a..b261937e5 100644
--- a/src/Items/ItemBottle.h
+++ b/src/Items/ItemBottle.h
@@ -84,8 +84,7 @@ public:
}
a_Player->GetInventory().RemoveOneEquippedItem();
- cItem NewItem(E_ITEM_POTION, 1, 0);
- a_Player->GetInventory().AddItem(NewItem);
+ a_Player->GetInventory().AddItem(cItem(E_ITEM_POTION));
return true;
}
} ;
diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h
index 487b66c8f..7a91149d1 100644
--- a/src/Items/ItemBucket.h
+++ b/src/Items/ItemBucket.h
@@ -163,8 +163,7 @@ public:
ASSERT(!"Inventory bucket mismatch");
return false;
}
- cItem Item(E_ITEM_BUCKET, 1);
- if (!a_Player->GetInventory().AddItem(Item))
+ if (!a_Player->GetInventory().AddItem(cItem(E_ITEM_BUCKET)))
{
return false;
}
diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h
index caeca2175..3f1c40d36 100644
--- a/src/Items/ItemFood.h
+++ b/src/Items/ItemFood.h
@@ -103,6 +103,11 @@ public:
return false;
}
+ if (!a_Player->IsGameModeCreative())
+ {
+ a_Player->GetInventory().RemoveOneEquippedItem();
+ }
+
switch (m_ItemType)
{
case E_ITEM_BEETROOT_SOUP:
diff --git a/src/Items/ItemMilk.h b/src/Items/ItemMilk.h
index 79c44509f..515c80493 100644
--- a/src/Items/ItemMilk.h
+++ b/src/Items/ItemMilk.h
@@ -29,7 +29,7 @@ public:
if (!a_Player->IsGameModeCreative())
{
a_Player->GetInventory().RemoveOneEquippedItem();
- a_Player->GetInventory().AddItem(E_ITEM_BUCKET);
+ a_Player->GetInventory().AddItem(cItem(E_ITEM_BUCKET));
}
return true;
}
diff --git a/src/Items/ItemPotion.h b/src/Items/ItemPotion.h
index 906991348..28f8002cc 100644
--- a/src/Items/ItemPotion.h
+++ b/src/Items/ItemPotion.h
@@ -75,7 +75,7 @@ public:
if (!a_Player->IsGameModeCreative())
{
a_Player->GetInventory().RemoveOneEquippedItem();
- a_Player->GetInventory().AddItem(E_ITEM_GLASS_BOTTLE);
+ a_Player->GetInventory().AddItem(cItem(E_ITEM_GLASS_BOTTLE));
}
return true;
}