diff options
| author | Shauren <shauren.trinity@gmail.com> | 2016-11-19 15:51:57 +0100 |
|---|---|---|
| committer | ariel- <ariel-@users.noreply.github.com> | 2016-11-19 23:41:38 -0300 |
| commit | 5237eda34014ee6d3fa8ca5c52148ff56cba666d (patch) | |
| tree | f3269f01e199584654c829d1521a18fcc243f523 /src | |
| parent | 25281ecb3198a543ddb18aab41b8a206512bdd0c (diff) | |
Core/Spells: Updated spell required items check, EquippedItemInventoryTypeMask should only be used for enchantments
(cherry picked from commit 28fd8a424d828f36a2b05ed016b12c4b8cf2607c)
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/game/Entities/Item/Item.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp index 9d60eb62be6..1173831be0b 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -824,13 +824,13 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const { ItemTemplate const* proto = GetTemplate(); + bool const isEnchantSpell = spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM) || spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) || spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC); if (spellInfo->EquippedItemClass != -1) // -1 == any item class { // Special case - accept vellum for armor/weapon requirements - if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum()) - ||(spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum())) - if (spellInfo->IsAbilityOfSkillType(SKILL_ENCHANTING)) // only for enchanting spells - return true; + if (isEnchantSpell && ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum()) + || (spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum()))) + return true; if (spellInfo->EquippedItemClass != int32(proto->Class)) return false; // wrong item class @@ -842,7 +842,7 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const } } - if (spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type + if (isEnchantSpell && spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type { // Special case - accept weapon type for main and offhand requirements if (proto->InventoryType == INVTYPE_WEAPON && |
