diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 4d8d44267..36573c593 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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 diff --git a/src/game/Player.h b/src/game/Player.h index ff21d4ba7..f613b096c 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1476,6 +1476,7 @@ class MANGOS_DLL_SPEC Player : public Unit void CharmSpellInitialize(); void PossessSpellInitialize(); bool HasSpell(uint32 spell) const; + bool HasActiveSpell(uint32 spell) const; // show in spellbook TrainerSpellState GetTrainerSpellState(TrainerSpell const* trainer_spell) const; bool IsSpellFitByClassAndRace( uint32 spell_id ) const; bool IsNeedCastPassiveSpellAtLearn(SpellEntry const* spellInfo) const; diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index e6343f999..70227980e 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -261,8 +261,8 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) return; } - // not have spell or spell passive and not casted by client - if ( !_player->HasSpell (spellId) || IsPassiveSpell(spellId) ) + // not have spell in spellbook or spell passive and not casted by client + if ( !_player->HasActiveSpell (spellId) || IsPassiveSpell(spellId) ) { //cheater? kick? ban? return; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4f669017d..6fb2f69c8 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7164" + #define REVISION_NR "7165" #endif // __REVISION_NR_H__