aboutsummaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index fce8575e7..cb8faecbc 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -335,8 +335,9 @@ ItemStack ItemStack::addItem(const ItemStack &newitem_,
*this = newitem;
newitem.clear();
}
- // If item name differs, bail out
- else if(name != newitem.name)
+ // If item name or metadata differs, bail out
+ else if (name != newitem.name
+ || metadata != newitem.metadata)
{
// cannot be added
}
@@ -374,8 +375,9 @@ bool ItemStack::itemFits(const ItemStack &newitem_,
{
newitem.clear();
}
- // If item name differs, bail out
- else if(name != newitem.name)
+ // If item name or metadata differs, bail out
+ else if (name != newitem.name
+ || metadata != newitem.metadata)
{
// cannot be added
}