Core/Misc: Another batch of fixes for issues found by static analysis

This commit is contained in:
Shauren committed 2013-05-19 11:15:54 +02:00
1 parent 933f50558b
commit 7da33b6bce
6 files changed
+15 -53

No files matched your search

+2 -20
View File
@@ -962,12 +962,7 @@ public:
uint32 id = atoi((char*)args);
bool found = false;
uint32 count = 0;
uint32 maxResults = 1;
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
if (spellInfo)
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id))
{
int locale = handler->GetSessionDbcLocale();
std::string name = spellInfo->SpellName[locale];
@@ -977,14 +972,6 @@ public:
return true;
}
if (locale < TOTAL_LOCALES)
{
if (maxResults && count++ == maxResults)
{
handler->PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
return true;
}
bool known = target && target->HasSpell(id);
bool learn = (spellInfo->Effects[0].Effect == SPELL_EFFECT_LEARN_SPELL);
@@ -1028,13 +1015,8 @@ public:
ss << handler->GetTrinityString(LANG_ACTIVE);
handler->SendSysMessage(ss.str().c_str());
if (!found)
found = true;
}
}
if (!found)
else
handler->SendSysMessage(LANG_COMMAND_NOSPELLFOUND);
return true;