[7253] Check battleground status in GetSpellAllowedInLocationError for some spells for aura remove and spell casting cases.

This commit is contained in:
VladimirMangos 2009-02-09 15:36:54 +03:00
parent 100429f29c
commit e97c7ad9c5
6 changed files with 41 additions and 12 deletions

View file

@ -3825,7 +3825,8 @@ uint8 Spell::CanCast(bool strict)
return SPELL_FAILED_NOT_IN_ARENA;
// zone check
if(uint8 res= GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),m_caster->GetZoneId(),m_caster->GetAreaId()))
if (uint8 res= GetSpellAllowedInLocationError(m_spellInfo,m_caster->GetMapId(),m_caster->GetZoneId(),m_caster->GetAreaId(),
m_caster->GetTypeId()==TYPEID_PLAYER ? ((Player*)m_caster)->GetBattleGroundId() : 0))
return res;
// not let players cast spells at mount (and let do it to creatures)