diff options
author | Shauren <shauren.trinity@gmail.com> | 2011-03-22 16:09:55 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2011-03-22 16:09:55 +0100 |
commit | d9c050437e53cc7ca39caa6c93cb871b3d0448f6 (patch) | |
tree | f30261d75b4dfaa77cf7082d696378d565de20fe /src | |
parent | f75e924d2216ddf1f774eb4dd1ae010fefbf9d40 (diff) |
Core/Spells: Fixed exploit allowing people to keep reagents when enchanting in trade
Closes #1012
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/Spell.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index a4d60df2f05..a091f9cbfdf 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -6000,8 +6000,15 @@ SpellCastResult Spell::CheckItems() // do not take reagents for these item casts if (!(m_CastItem && m_CastItem->GetProto()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)) { + bool checkReagents = !m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo); + // Not own traded item (in trader trade slot) requires reagents even if triggered spell + if (!checkReagents) + if (Item* targetItem = m_targets.getItemTarget()) + if (targetItem->GetOwnerGUID() != m_caster->GetGUID()) + checkReagents = true; + // check reagents (ignore triggered spells with reagents processed by original spell) and special reagent ignore case. - if (!m_IsTriggeredSpell && !p_caster->CanNoReagentCast(m_spellInfo)) + if (checkReagents) { for (uint32 i = 0; i < MAX_SPELL_REAGENTS; i++) { @@ -6028,7 +6035,7 @@ SpellCastResult Spell::CheckItems() } } } - if (!p_caster->HasItemCount(itemid,itemcount)) + if (!p_caster->HasItemCount(itemid, itemcount)) return SPELL_FAILED_ITEM_NOT_READY; //0x54 } } |