From e5088b85221d870efc86f11f6bafac5e9cd76e7b Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 17 Apr 2009 15:10:43 -0500 Subject: *Use EventAI as default AIName for creatures without an AIName but with eventai scripts. --HG-- branch : trunk --- src/game/CreatureEventAIMgr.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp index 5ac08400804..353b6102a4e 100644 --- a/src/game/CreatureEventAIMgr.cpp +++ b/src/game/CreatureEventAIMgr.cpp @@ -545,8 +545,21 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts() m_CreatureEventAI_Event_Map[creature_id].push_back(temp); ++Count; - if(cInfo->AIName == "") - const_cast(cInfo)->AIName = "EventAI"; + if(!cInfo->AIName || !cInfo->AIName[0]) + { + //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but its AIName is empty. Set to EventAI as default.", cInfo->Entry); + size_t len = strlen("EventAI")+1; + const_cast(cInfo)->AIName = new char[len]; + strncpy(const_cast(cInfo->AIName), "EventAI", len); + } + if(strcmp(cInfo->AIName, "EventAI")) + { + //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it has AIName %s. EventAI script will be overriden.", cInfo->Entry, cInfo->AIName); + } + if(cInfo->ScriptID) + { + //sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it also has C++ script. EventAI script will be overriden.", cInfo->Entry); + } } while (result->NextRow()); delete result; -- cgit v1.2.3