Core/Auras: Simplified SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS handling

This commit is contained in:
Shauren committed 2012-08-13 14:56:56 +02:00
1 parent 3ad20d6bbd
commit 8819f30a12
4 files changed
+23 -63

No files matched your search

+21 -2
View File
@@ -350,8 +350,6 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
return;
}
if (Player* plrMover = mover->ToPlayer())
spellId = plrMover->GetSpellForCast(spellId);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
@@ -382,6 +380,27 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
}
}
Unit::AuraEffectList swaps = mover->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS);
Unit::AuraEffectList const& swaps2 = mover->GetAuraEffectsByType(SPELL_AURA_OVERRIDE_ACTIONBAR_SPELLS_2);
if (!swaps2.empty())
swaps.insert(swaps.end(), swaps2.begin(), swaps2.end());
if (!swaps.empty())
{
for (Unit::AuraEffectList::const_iterator itr = swaps.begin(); itr != swaps.end(); ++itr)
{
if ((*itr)->IsAffectingSpell(spellInfo))
{
if (SpellInfo const* newInfo = sSpellMgr->GetSpellInfo((*itr)->GetAmount()))
{
spellInfo = newInfo;
spellId = newInfo->Id;
}
break;
}
}
}
// Client is resending autoshot cast opcode when other spell is casted during shoot rotation
// Skip it to prevent "interrupt" message
if (spellInfo->IsAutoRepeatRangedSpell() && _player->GetCurrentSpell(CURRENT_AUTOREPEAT_SPELL)