From 8e3b63bd28579d8f8cb3e7844600504f12b087a5 Mon Sep 17 00:00:00 2001 From: ANAND ︻气デ═一 Date: Sat, 11 May 2019 22:18:27 +0530 Subject: Define operators == and != for ItemStack --- src/inventory.cpp | 9 ++------- src/inventory.h | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src') 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; iname == s.name && + this->count == s.count && + this->wear == s.wear && + this->metadata == s.metadata); + } + + bool operator !=(const ItemStack &s) const + { + return !(*this == s); + } + /* Properties */ -- cgit v1.2.3