From dcc3af0704f63caefd39d8488f8c6ff28c208bfd Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 4 Jun 2013 11:54:44 +0000 Subject: Added cItem copy-constructor to Lua API, made cItem::IsEqual() and IsStackable() enchantment-aware git-svn-id: http://mc-server.googlecode.com/svn/trunk@1546 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Item.h | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/Item.h') diff --git a/source/Item.h b/source/Item.h index fee549a2c..d0ba37b41 100644 --- a/source/Item.h +++ b/source/Item.h @@ -58,6 +58,16 @@ public: } + /// Creates an exact copy of the item + cItem(const cItem & a_CopyFrom) : + m_ItemType (a_CopyFrom.m_ItemType), + m_ItemCount (a_CopyFrom.m_ItemCount), + m_ItemDamage (a_CopyFrom.m_ItemDamage), + m_Enchantments(a_CopyFrom.m_Enchantments) + { + } + + void Empty(void) { m_ItemType = E_ITEM_EMPTY; @@ -83,7 +93,11 @@ public: bool IsEqual(const cItem & a_Item) const { - return (IsSameType(a_Item) && (m_ItemDamage == a_Item.m_ItemDamage)); + return ( + IsSameType(a_Item) && + (m_ItemDamage == a_Item.m_ItemDamage) && + (m_Enchantments == a_Item.m_Enchantments) + ); } -- cgit v1.2.3