Core/Items: Corrected all spellid checks from item_template to also check -1
Closes #15797
This commit is contained in:
1 parent
570e6baa09
commit
965d29484b
3 files changed
+7
-7
No files matched your search
@@ -8101,7 +8101,7 @@ void Player::ApplyItemEquipSpell(Item* item, bool apply, bool form_change)
|
||||
_Spell const& spellData = proto->Spells[i];
|
||||
|
||||
// no spell
|
||||
if (!spellData.SpellId)
|
||||
if (spellData.SpellId <= 0)
|
||||
continue;
|
||||
|
||||
// wrong triggering type
|
||||
@@ -8229,7 +8229,7 @@ void Player::CastItemCombatSpell(Unit* target, WeaponAttackType attType, uint32
|
||||
_Spell const& spellData = proto->Spells[i];
|
||||
|
||||
// no spell
|
||||
if (!spellData.SpellId)
|
||||
if (spellData.SpellId <= 0)
|
||||
continue;
|
||||
|
||||
// wrong triggering type
|
||||
@@ -8358,7 +8358,7 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
|
||||
_Spell const& spellData = proto->Spells[i];
|
||||
|
||||
// no spell
|
||||
if (!spellData.SpellId)
|
||||
if (spellData.SpellId <= 0)
|
||||
continue;
|
||||
|
||||
// wrong triggering type
|
||||
@@ -22713,7 +22713,7 @@ void Player::ApplyEquipCooldown(Item* pItem)
|
||||
_Spell const& spellData = pItem->GetTemplate()->Spells[i];
|
||||
|
||||
// no spell
|
||||
if (!spellData.SpellId)
|
||||
if (spellData.SpellId <= 0)
|
||||
continue;
|
||||
|
||||
// wrong triggering type (note: ITEM_SPELLTRIGGER_ON_NO_DELAY_USE not have cooldown)
|
||||
|
||||
@@ -2521,7 +2521,7 @@ void ObjectMgr::LoadItemTemplates()
|
||||
if (!req)
|
||||
for (uint8 j = 0; j < MAX_ITEM_PROTO_SPELLS; ++j)
|
||||
{
|
||||
if (itemTemplate.Spells[j].SpellId)
|
||||
if (itemTemplate.Spells[j].SpellId > 0)
|
||||
{
|
||||
req = true;
|
||||
break;
|
||||
|
||||
@@ -4253,7 +4253,7 @@ void Spell::TakeCastItem()
|
||||
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
{
|
||||
if (proto->Spells[i].SpellId)
|
||||
if (proto->Spells[i].SpellId > 0)
|
||||
{
|
||||
// item has limited charges
|
||||
if (proto->Spells[i].SpellCharges)
|
||||
@@ -6044,7 +6044,7 @@ SpellCastResult Spell::CheckItems()
|
||||
for (uint8 e = 0; e < MAX_ITEM_PROTO_SPELLS; ++e)
|
||||
{
|
||||
ItemTemplate const* proto = targetItem->GetTemplate();
|
||||
if (proto->Spells[e].SpellId && (
|
||||
if (proto->Spells[e].SpellId > 0 && (
|
||||
proto->Spells[e].SpellTrigger == ITEM_SPELLTRIGGER_ON_USE ||
|
||||
proto->Spells[e].SpellTrigger == ITEM_SPELLTRIGGER_ON_NO_DELAY_USE))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user