Inventory: Make ItemStack with different metadata not stackable

This commit is contained in:
Xunto 2016-04-22 15:49:06 +03:00 committed by paramat
parent 31c1fca6fd
commit ae7fb9b5be

@ -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
}