[7165] More strict checking for client casted spells.

Allow explictly cast character spell from client only if it non-passive and show in spellbook/etc base at server data.
This commit is contained in:
VladimirMangos 2009-01-25 00:08:16 +03:00
parent 68b537dc30
commit df13468ee1
4 changed files with 13 additions and 4 deletions

View file

@ -3560,7 +3560,15 @@ void Player::DestroyForPlayer( Player *target ) const
bool Player::HasSpell(uint32 spell) const
{
PlayerSpellMap::const_iterator itr = m_spells.find(spell);
return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED && !itr->second->disabled);
return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED &&
!itr->second->disabled);
}
bool Player::HasActiveSpell(uint32 spell) const
{
PlayerSpellMap::const_iterator itr = m_spells.find(spell);
return (itr != m_spells.end() && itr->second->state != PLAYERSPELL_REMOVED &&
itr->second->active && !itr->second->disabled);
}
TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell) const