mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 22:37:02 +00:00
[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:
parent
84e5f7520b
commit
52701a58f6
9 changed files with 130 additions and 94 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue