From 9620e011576de77da196e3fc5d607c7274a80361 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 24 Jun 2011 03:27:57 +0400 Subject: [PATCH] [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` --- src/game/CreatureEventAIMgr.cpp | 17 +++++++++++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index 852824a54..667a5841f 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -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(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(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 33d71b7d2..d46c5651e 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11662" + #define REVISION_NR "11663" #endif // __REVISION_NR_H__