summaryrefslogtreecommitdiff
path: root/src/inventory.cpp
diff options
context:
space:
mode:
authorANAND ︻气デ═一 <ClobberXD@gmail.com>2019-05-11 22:18:27 +0530
committersfan5 <sfan5@live.de>2019-05-11 18:48:27 +0200
commit8e3b63bd28579d8f8cb3e7844600504f12b087a5 (patch)
tree43e963c21839c92cbc3f81e19c899cb055a8cd04 /src/inventory.cpp
parent72feab081c336d2d71d300131d30e71694b485f3 (diff)
downloadminetest-8e3b63bd28579d8f8cb3e7844600504f12b087a5.tar.gz
minetest-8e3b63bd28579d8f8cb3e7844600504f12b087a5.tar.bz2
minetest-8e3b63bd28579d8f8cb3e7844600504f12b087a5.zip
Define operators == and != for ItemStack
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r--src/inventory.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp
index 3bc67da1b..2335136b1 100644
--- a/src/inventory.cpp
+++ b/src/inventory.cpp
@@ -508,14 +508,9 @@ bool InventoryList::operator == (const InventoryList &other) const
return false;
if(m_name != other.m_name)
return false;
- for(u32 i=0; i<m_items.size(); i++)
- {
- ItemStack s1 = m_items[i];
- ItemStack s2 = other.m_items[i];
- if(s1.name != s2.name || s1.wear!= s2.wear || s1.count != s2.count ||
- s1.metadata != s2.metadata)
+ for (u32 i = 0; i < m_items.size(); i++)
+ if (m_items[i] != other.m_items[i])
return false;
- }
return true;
}