aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureEventAIMgr.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-15 16:41:36 -0500
committermegamage <none@none>2009-05-15 16:41:36 -0500
commitf5af5ea9e3b12cf920c989484776ad57f44c39ed (patch)
tree50615588c874160d10a2faa8ae6d9cf0f0a5ee56 /src/game/CreatureEventAIMgr.cpp
parent15c78a728e08ce95999b980ce7572092bc0a75cb (diff)
[7834] Mangos string loading code cleanups. Author: VladimirMangos
* Better integration creature event ai strings. * Not inclide in checks as expected max mangos strings range value to range --HG-- branch : trunk
Diffstat (limited to 'src/game/CreatureEventAIMgr.cpp')
-rw-r--r--src/game/CreatureEventAIMgr.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/game/CreatureEventAIMgr.cpp b/src/game/CreatureEventAIMgr.cpp
index 48c6082a4d4..01c92ade6db 100644
--- a/src/game/CreatureEventAIMgr.cpp
+++ b/src/game/CreatureEventAIMgr.cpp
@@ -36,7 +36,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
m_CreatureEventAI_TextMap.clear();
// Load EventAI Text
- LoadTrinityStrings(WorldDatabase,"creature_ai_texts",-1,1+(TEXT_SOURCE_RANGE));
+ objmgr.LoadTrinityStrings(WorldDatabase,"creature_ai_texts",MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
// Gather Additional data from EventAI Texts
QueryResult *result = WorldDatabase.PQuery("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
@@ -59,15 +59,17 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Texts()
temp.Language = fields[3].GetInt32();
temp.Emote = fields[4].GetInt32();
- if (i >= 0)
+ // range negative
+ if (i > MIN_CREATURE_AI_TEXT_STRING_ID || i <= MAX_CREATURE_AI_TEXT_STRING_ID)
{
- sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not a negative value.",i);
+ sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is not in valid range(%d-%d)",i,MIN_CREATURE_AI_TEXT_STRING_ID,MAX_CREATURE_AI_TEXT_STRING_ID);
continue;
}
- if (i <= TEXT_SOURCE_RANGE)
+ // range negative (don't must be happen, loaded from same table)
+ if (!objmgr.GetTrinityStringLocale(i))
{
- sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` is out of accepted entry range for table.",i);
+ sLog.outErrorDb("CreatureEventAI: Entry %i in table `creature_ai_texts` not found",i);
continue;
}