Skip to content

Commit

Permalink
[9345] Show enchantment applied to item in trade slot to caster after…
Browse files Browse the repository at this point in the history
… apply.

Also more strictly check cases when in spell targets presetn item in trade slot.
  • Loading branch information
VladimirMangos committed Feb 10, 2010
1 parent 2a81ef3 commit c12fd0e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game/Spell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void SpellCastTargets::Update(Unit* caster)
{
if(m_targetMask & TARGET_FLAG_ITEM)
m_itemTarget = ((Player*)caster)->GetItemByGuid(m_itemTargetGUID);
else
else if(m_targetMask & TARGET_FLAG_TRADE_ITEM)
{
Player* pTrader = ((Player*)caster)->GetTrader();
if(pTrader && m_itemTargetGUID < TRADE_SLOT_COUNT)
Expand Down
12 changes: 12 additions & 0 deletions src/game/SpellEffects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4071,6 +4071,10 @@ void Spell::EffectEnchantItemPerm(uint32 effect_idx)

// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget,PERM_ENCHANTMENT_SLOT,true);

// update trade window for show enchantment for caster in trade window
if (m_targets.m_targetMask & TARGET_FLAG_TRADE_ITEM)
p_caster->GetSession()->SendUpdateTrade();
}

void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)
Expand Down Expand Up @@ -4129,6 +4133,10 @@ void Spell::EffectEnchantItemPrismatic(uint32 effect_idx)

// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget,PRISMATIC_ENCHANTMENT_SLOT,true);

// update trade window for show enchantment for caster in trade window
if (m_targets.m_targetMask & TARGET_FLAG_TRADE_ITEM)
p_caster->GetSession()->SendUpdateTrade();
}

void Spell::EffectEnchantItemTmp(uint32 i)
Expand Down Expand Up @@ -4256,6 +4264,10 @@ void Spell::EffectEnchantItemTmp(uint32 i)

// add new enchanting if equipped
item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, true);

// update trade window for show enchantment for caster in trade window
if (m_targets.m_targetMask & TARGET_FLAG_TRADE_ITEM)
p_caster->GetSession()->SendUpdateTrade();
}

void Spell::EffectTameCreature(uint32 /*i*/)
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9344"
#define REVISION_NR "9345"
#endif // __REVISION_NR_H__

0 comments on commit c12fd0e

Please sign in to comment.