1
0

Fixed cItem::IsStackableWith()

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1547 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2013-06-04 11:59:20 +00:00
parent dcc3af0704
commit 4b17c3ac1a
3 changed files with 20 additions and 1 deletions

View File

@ -203,6 +203,15 @@ bool cEnchantments::operator ==(const cEnchantments & a_Other) const
bool cEnchantments::operator !=(const cEnchantments & a_Other) const
{
return m_Enchantments != a_Other.m_Enchantments;
}
void cEnchantments::WriteToNBTCompound(cFastNBTWriter & a_Writer, const AString & a_ListTagName) const void cEnchantments::WriteToNBTCompound(cFastNBTWriter & a_Writer, const AString & a_ListTagName) const
{ {
// Write the enchantments into the specified NBT writer // Write the enchantments into the specified NBT writer

View File

@ -90,6 +90,9 @@ public:
/// Returns true if a_Other contains exactly the same enchantments and levels /// Returns true if a_Other contains exactly the same enchantments and levels
bool operator ==(const cEnchantments & a_Other) const; bool operator ==(const cEnchantments & a_Other) const;
/// Returns true if a_Other doesn't contain exactly the same enchantments and levels
bool operator !=(const cEnchantments & a_Other) const;
// tolua_end // tolua_end
/// Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments") /// Writes the enchantments into the specified NBT writer; begins with the LIST tag of the specified name ("ench" or "StoredEnchantments")

View File

@ -81,8 +81,15 @@ bool cItem::IsStackableWith(const cItem & a_OtherStack) const
{ {
return false; return false;
} }
if (a_OtherStack.m_ItemDamage != m_ItemDamage)
{
return false;
}
if (a_OtherStack.m_Enchantments != m_Enchantments)
{
return false;
}
// TODO: match enchantments etc.
return true; return true;
} }