Skip to content
Permalink
Browse files

Inventory: Make ItemStack with different metadata not stackable

  • Loading branch information...
xunto authored and paramat committed Apr 22, 2016
1 parent 31c1fca commit ae7fb9b5bea291f81a82912d42fc43b7e71702bf
Showing with 6 additions and 4 deletions.
  1. +6 −4 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
}

0 comments on commit ae7fb9b

Please sign in to comment.
You can’t perform that action at this time.