summaryrefslogtreecommitdiffstats
path: root/source/cItem.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/cItem.h41
1 files changed, 34 insertions, 7 deletions
diff --git a/source/cItem.h b/source/cItem.h
index 15a6e3ca1..53764d06a 100644
--- a/source/cItem.h
+++ b/source/cItem.h
@@ -39,9 +39,23 @@ public:
{
return (m_ItemID <= 0 || m_ItemCount <= 0);
}
- bool Equals( cItem & a_Item ) const
+
+ // tolua_end
+ OBSOLETE
+ // tolua_begin
+ bool Equals(const cItem & a_Item) const // obsolete, use IsEqual() instead
+ {
+ return IsEqual(a_Item);
+ }
+
+ bool IsEqual(const cItem & a_Item) const
+ {
+ return (IsSameType(a_Item) && (m_ItemHealth == a_Item.m_ItemHealth));
+ }
+
+ bool IsSameType(const cItem & a_Item) const
{
- return ( (m_ItemID == a_Item.m_ItemID) && (m_ItemHealth == a_Item.m_ItemHealth) );
+ return (m_ItemID == a_Item.m_ItemID) || (IsEmpty() && a_Item.IsEmpty());
}
// TODO Sorry for writing the functions in the header. But somehow it doesn´t worked when I put them into the cpp File :s
@@ -100,12 +114,25 @@ public:
void FromJson( const Json::Value & a_Value );
// tolua_begin
- static bool IsEnchantable(ENUM_ITEM_ID item);
-
- ENUM_ITEM_ID m_ItemID;
- char m_ItemCount;
- short m_ItemHealth;
+ static bool IsEnchantable(short a_ItemType);
+ // tolua_end
+ union
+ {
+ // tolua_begin
+ ENUM_ITEM_ID m_ItemID; // OBSOLETE, use m_ItemType instead
+ short m_ItemType;
+ // tolua_end
+ } ;
+ char m_ItemCount; // tolua_export
+ union
+ {
+ // tolua_begin
+ short m_ItemHealth; // OBSOLETE, use m_ItemDamage instead
+ short m_ItemDamage;
+ // tolua_end
+ } ;
+ // tolua_begin
};
// tolua_end