Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Inventory: Make ItemStack with different metadata not stackable
  • Loading branch information
xunto authored and paramat committed Apr 26, 2016
1 parent 31c1fca commit ae7fb9b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/inventory.cpp
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit ae7fb9b

Please sign in to comment.