Core/Spells: Move hacky check for spec changing to its correct location
--HG-- branch : trunk
This commit is contained in:
@@ -24059,11 +24059,6 @@ void Player::ActivateSpec(uint8 spec)
|
|||||||
if (spec > GetSpecsCount())
|
if (spec > GetSpecsCount())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO:
|
|
||||||
// HACK: this shouldn't be checked at such a low level function but rather at the moment the spell is casted
|
|
||||||
if (GetMap()->IsBattleground() && !HasAura(44521)) // In Battleground with no Preparation buff
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (IsNonMeleeSpellCasted(false))
|
if (IsNonMeleeSpellCasted(false))
|
||||||
InterruptNonMeleeSpells(false);
|
InterruptNonMeleeSpells(false);
|
||||||
|
|
||||||
|
|||||||
@@ -6933,6 +6933,14 @@ void Spell::EffectSpecCount(SpellEffIndex /*effIndex*/)
|
|||||||
|
|
||||||
void Spell::EffectActivateSpec(SpellEffIndex /*effIndex*/)
|
void Spell::EffectActivateSpec(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
|
// can't change during already started arena/battleground
|
||||||
|
if (Battleground const* bg = m_caster->ToPlayer()->GetBattleground())
|
||||||
|
if (bg->GetStatus() == STATUS_IN_PROGRESS)
|
||||||
|
{
|
||||||
|
SendCastResult(SPELL_FAILED_NOT_IN_BATTLEGROUND);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user