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; *this = newitem;
newitem.clear(); newitem.clear();
} }
// If item name differs, bail out // If item name or metadata differs, bail out
else if(name != newitem.name) else if (name != newitem.name
|| metadata != newitem.metadata)
{ {
// cannot be added // cannot be added
} }
@ -374,8 +375,9 @@ bool ItemStack::itemFits(const ItemStack &newitem_,
{ {
newitem.clear(); newitem.clear();
} }
// If item name differs, bail out // If item name or metadata differs, bail out
else if(name != newitem.name) else if (name != newitem.name
|| metadata != newitem.metadata)
{ {
// cannot be added // cannot be added
} }