Fix startup errors with 1.7.1 client.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user