[11663] Check at EventAI scripts load diff reqs for event ai real call

* Script existence <-> `creature_template`.`AIName`="EventAI"
* In strict DB check mode: script existence conflict with setting `creature_template`.`ScriptName`
This commit is contained in:
VladimirMangos 2011-06-24 03:27:57 +04:00
parent 0413ff9c34
commit 9620e01157
2 changed files with 18 additions and 1 deletions

View file

@ -815,6 +815,23 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
delete result;
// post check
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
{
if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
{
bool ainame = strcmp(cInfo->AIName, "EventAI") == 0;
bool hasevent = m_CreatureEventAI_Event_Map.find(i) != m_CreatureEventAI_Event_Map.end();
if (ainame && !hasevent)
sLog.outErrorDb("CreatureEventAI: EventAI not has script for creature entry (%u), but AIName = '%s'.", i, cInfo->AIName);
else if (!ainame && hasevent)
sLog.outErrorDb("CreatureEventAI: EventAI has script for creature entry (%u), but AIName = '%s' instead 'EventAI'.", i, cInfo->AIName);
if (hasevent && cInfo->ScriptID && !sLog.HasLogFilter(LOG_FILTER_DB_STRICTED_CHECK))
sLog.outErrorDb("CreatureEventAI: EventAI has script for creature entry (%u), but it have associated library script: %s.", i, sScriptMgr.GetScriptName(cInfo->ScriptID));
}
}
CheckUnusedAITexts();
CheckUnusedAISummons();

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11662"
#define REVISION_NR "11663"
#endif // __REVISION_NR_H__