diff --git a/src/game/Object/Player.cpp b/src/game/Object/Player.cpp index 60e29be2..24217364 100644 --- a/src/game/Object/Player.cpp +++ b/src/game/Object/Player.cpp @@ -2874,6 +2874,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen } TalentSpellPos const* talentPos = GetTalentSpellPos(spell_id); + bool canAddToSpellBook = true; if (!disabled_case) // skip new spell adding if spell already known (disabled spells case) { @@ -2908,8 +2909,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen newspell.dependent = dependent; newspell.disabled = disabled; - bool canAddToSpellBook = true; - // replace spells in action bars and spellbook to bigger rank if only one spell rank must be accessible if (newspell.active && !newspell.disabled) { @@ -2968,8 +2967,8 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen m_spells[spell_id] = newspell; - // return false if spell disabled or spell is non-stackable in spellbook - if (newspell.disabled || !canAddToSpellBook) + // return false if spell disabled + if (newspell.disabled) { return false; } } @@ -3080,7 +3079,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen } // return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell - return active && !disabled; + return active && !disabled && canAddToSpellBook; } bool Player::IsNeedCastPassiveLikeSpellAtLearn(SpellEntry const* spellInfo) const diff --git a/src/game/WorldHandlers/ChatHandler.cpp b/src/game/WorldHandlers/ChatHandler.cpp index 56f1b1d1..5708bab8 100644 --- a/src/game/WorldHandlers/ChatHandler.cpp +++ b/src/game/WorldHandlers/ChatHandler.cpp @@ -597,25 +597,16 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recv_data) if (!sEluna->OnChat(GetPlayer(), type, lang, msg, chn)) return; #endif /* ENABLE_ELUNA */ - - chn->Say(_player, msg.c_str(), lang); - } - } - #ifdef ENABLE_PLAYERBOTS - if (ChannelMgr* cMgr = channelMgr(_player->GetTeam())) - { - if (Channel* chn = cMgr->GetChannel(channel, _player)) - { if (_player->GetPlayerbotMgr() && chn->GetFlags() & 0x18) { _player->GetPlayerbotMgr()->HandleCommand(type, msg); } sRandomPlayerbotMgr.HandleCommand(type, msg, *_player); - chn->Say(_player, msg.c_str(), lang); +#endif /* ENABLE_PLAYERBOTS */ + chn->Say(_player, msg.c_str(), lang); } } -#endif } break;