mirror of
https://github.com/minetest/minetest.git
synced 2024-11-09 01:03:46 +01:00
Inventory: Make ItemStack with different metadata not stackable
This commit is contained in:
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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user