diff options
| author | Shauren <shauren.trinity@gmail.com> | 2013-05-30 20:57:07 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2013-05-30 20:57:07 +0200 |
| commit | adb78862da66b13984c6494befdffbf5da0cdbe6 (patch) | |
| tree | 1514857a0131189194c251b7045d234a2bf45d86 /src/server/game/Spells | |
| parent | cf23793b4b04cfe12f6fc1441a7d9f8192f7dfa6 (diff) | |
| parent | 3a697d4c9f5e9f2fa9c3b08c8e103d90472a871a (diff) | |
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts:
src/server/game/Achievements/AchievementMgr.cpp
src/server/game/Entities/Unit/Unit.cpp
src/server/game/Entities/Vehicle/Vehicle.cpp
src/server/game/Handlers/ItemHandler.cpp
src/server/game/Handlers/MailHandler.cpp
src/server/game/Server/Protocol/Opcodes.cpp
src/server/game/Server/Protocol/Opcodes.h
src/server/scripts/Commands/cs_misc.cpp
Diffstat (limited to 'src/server/game/Spells')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 10 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 3 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4be79d4b52b..80eadb9ac0e 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2602,7 +2602,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) // remove old enchanting before applying new if equipped item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, false); - itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0); + itemTarget->SetEnchantment(PERM_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID()); // add new enchanting if equipped item_owner->ApplyEnchantment(itemTarget, PERM_ENCHANTMENT_SLOT, true); @@ -2667,7 +2667,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex) // remove old enchanting before applying new if equipped item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, false); - itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0); + itemTarget->SetEnchantment(PRISMATIC_ENCHANTMENT_SLOT, enchant_id, 0, 0, m_caster->GetGUID()); // add new enchanting if equipped item_owner->ApplyEnchantment(itemTarget, PRISMATIC_ENCHANTMENT_SLOT, true); @@ -2749,7 +2749,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex) // remove old enchanting before applying new if equipped item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, false); - itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0); + itemTarget->SetEnchantment(TEMP_ENCHANTMENT_SLOT, enchant_id, duration * 1000, 0, m_caster->GetGUID()); // add new enchanting if equipped item_owner->ApplyEnchantment(itemTarget, TEMP_ENCHANTMENT_SLOT, true); @@ -4243,7 +4243,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex) if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - Player* item_owner = (Player*)unitTarget; + Player* item_owner = unitTarget->ToPlayer(); Item* item = item_owner->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_MAINHAND); if (!item) @@ -4274,7 +4274,7 @@ void Spell::EffectEnchantHeldItem(SpellEffIndex effIndex) return; // Apply the temporary enchantment - item->SetEnchantment(slot, enchant_id, duration*IN_MILLISECONDS, 0); + item->SetEnchantment(slot, enchant_id, duration*IN_MILLISECONDS, 0, m_caster->GetGUID()); item_owner->ApplyEnchantment(item, slot, true); } } diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index a2a4a85808a..3ee6266b0d2 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -499,6 +499,9 @@ uint32 SpellMgr::GetSpellIdForDifficulty(uint32 spellId, Unit const* caster) con SpellInfo const* SpellMgr::GetSpellForDifficultyFromSpell(SpellInfo const* spell, Unit const* caster) const { + if (!spell) + return NULL; + uint32 newSpellId = GetSpellIdForDifficulty(spell->Id, caster); SpellInfo const* newSpell = GetSpellInfo(newSpellId); if (!newSpell) |
