feat(Core/Instance): Add instance validation for creature scripts (#4596)

This commit is contained in:
Kitzunu
2021-04-05 15:34:26 +02:00
committed by GitHub
parent 60f865fce6
commit f9d708b450
371 changed files with 1315 additions and 767 deletions

View File

@@ -5288,7 +5288,7 @@ void ObjectMgr::ValidateSpellScripts()
bool valid = true;
if (!spellScript && !auraScript)
{
sLog->outError("TSCR: Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second));
sLog->outError("TSCR: Functions GetSpellScript() and GetAuraScript() of script `%s` do not return objects - script skipped", GetScriptName(sitr->second->second).c_str());
valid = false;
}
if (spellScript)
@@ -8849,6 +8849,12 @@ void ObjectMgr::LoadScriptNames()
sLog->outString();
}
std::string const& ObjectMgr::GetScriptName(uint32 id) const
{
static std::string const empty = "";
return (id < _scriptNamesStore.size()) ? _scriptNamesStore[id] : empty;
}
uint32 ObjectMgr::GetScriptId(const char* name)
{
// use binary search to find the script name in the sorted vector