mirror of
https://github.com/minetest/minetest.git
synced 2024-11-27 01:53:45 +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;
|
*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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user