diff options
author | megamage <none@none> | 2009-04-17 15:10:43 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-17 15:10:43 -0500 |
commit | e5088b85221d870efc86f11f6bafac5e9cd76e7b (patch) | |
tree | 3ded37419ce1c06bab5e1ed83e7655ce80a0d78e | |
parent | c7d78b5ff930b433c7f09471e825b79e6d9bee4f (diff) |
*Use EventAI as default AIName for creatures without an AIName but with eventai scripts.
--HG--
branch : trunk
-rw-r--r-- | src/game/CreatureEventAIMgr.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
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<CreatureInfo*>(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<CreatureInfo*>(cInfo)->AIName = new char[len]; + strncpy(const_cast<char*>(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; |