Merge pull request #8423 from joschiwald/conditions

Core/Conditions: use proper SpellCastResult instead of Notification when CONDITION_SOURCE_TYPE_SPELL fails
This commit is contained in:
Shauren
2012-11-24 08:25:45 -08:00
6 changed files with 70 additions and 30 deletions

View File

@@ -937,16 +937,9 @@ public:
//No args required for players
if (handler->GetSession() && AccountMgr::IsPlayerAccount(handler->GetSession()->GetSecurity()))
{
Player* player = handler->GetSession()->GetPlayer();
if (player->isInFlight() || player->isInCombat())
{
handler->SendSysMessage(LANG_CANT_DO_NOW);
handler->SetSentErrorMessage(true);
return false;
}
//7355: "Stuck"
player->CastSpell(player, 7355, false);
// 7355: "Stuck"
if (Player* player = handler->GetSession()->GetPlayer())
player->CastSpell(player, 7355, false);
return true;
}
@@ -967,8 +960,13 @@ public:
if (player->isInFlight() || player->isInCombat())
{
handler->SendSysMessage(LANG_CANT_DO_NOW);
handler->SetSentErrorMessage(true);
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(7355);
if (!spellInfo)
return false;
if (Player* caster = handler->GetSession()->GetPlayer())
Spell::SendCastResult(caster, spellInfo, 0, SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW);
return false;
}