Fix startup errors with 1.7.1 client.

This commit is contained in:
ratkosrb
2019-07-21 12:16:27 +03:00
parent 7df88867ed
commit 65a91b677d
4 changed files with 151 additions and 8 deletions
+15
View File
@@ -1255,6 +1255,18 @@ void ScriptMgr::LoadSpellScripts()
{
LoadScripts(sSpellScripts, "spell_scripts");
std::set<uint32> scriptSpells;
std::unique_ptr<QueryResult> result(WorldDatabase.Query("SELECT `entry` FROM `spell_template` WHERE 77 IN (`effect1`, `effect2`, `effect3`)"));
if (result)
{
do
{
Field* fields = result->Fetch();
uint32 spellId = fields[0].GetUInt32();
scriptSpells.insert(spellId);
} while (result->NextRow());
}
// check ids
for (ScriptMapMap::const_iterator itr = sSpellScripts.begin(); itr != sSpellScripts.end(); ++itr)
{
@@ -1282,6 +1294,9 @@ void ScriptMgr::LoadSpellScripts()
}
}
if (scriptSpells.find(itr->first) != scriptSpells.cend())
found = true;
if (!found)
sLog.outErrorDb("Table `spell_scripts` has unsupported spell (Id: %u) without SPELL_EFFECT_SCRIPT_EFFECT (%u) spell effect", itr->first, SPELL_EFFECT_SCRIPT_EFFECT);
}