[9509] Move custom data from item spell charges sign to new field NoConsumable.

Some items with negative by defaul charges not expected to be deletedt at no charges.
In past this fixed by using positive charges amount in like cases in different from
expected negative value. Adding new field for avoid this.
This commit is contained in:
VladimirMangos 2010-03-03 09:07:16 +03:00
parent 84e5f7520b
commit 52701a58f6
9 changed files with 130 additions and 94 deletions

View file

@ -3670,7 +3670,7 @@ void Spell::TakeCastItem()
// item has limited charges
if (proto->Spells[i].SpellCharges)
{
if (proto->Spells[i].SpellCharges < 0)
if (proto->Spells[i].SpellCharges < 0 && !proto->NonConsumable)
expendable = true;
int32 charges = m_CastItem->GetSpellCharges(i);
@ -5553,7 +5553,7 @@ SpellCastResult Spell::CheckItems()
{
// CastItem will be used up and does not count as reagent
int32 charges = m_CastItem->GetSpellCharges(s);
if (proto->Spells[s].SpellCharges < 0 && abs(charges) < 2)
if (proto->Spells[s].SpellCharges < 0 && !proto->NonConsumable && abs(charges) < 2)
{
++itemcount;
break;