Merge pull request #94 from H0zen/develop21

Various fixes. Fixes #1017
This commit is contained in:
MadMax 2016-03-02 00:30:59 +00:00
commit a30e9df93e
2 changed files with 6 additions and 16 deletions

View File

@ -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

View File

@ -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);
#endif /* ENABLE_PLAYERBOTS */
chn->Say(_player, msg.c_str(), lang);
}
}
#endif
} break;