mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
*Fix a bug that event ai text is loaded twice.
--HG-- branch : trunk
This commit is contained in:
@@ -663,71 +663,6 @@ void LoadDatabase()
|
||||
// Drop Existing Text Map, only done once and we are ready to add data from multiple sources.
|
||||
TextMap.clear();
|
||||
|
||||
// Load EventAI Text
|
||||
outstring_log("TSCR: Loading EventAI Texts...");
|
||||
LoadTrinityStrings(TScriptDB,"creature_ai_texts",-1,1+(TEXT_SOURCE_RANGE));
|
||||
|
||||
// Gather Additional data from EventAI Texts
|
||||
result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM creature_ai_texts");
|
||||
|
||||
outstring_log("TSCR: Loading EventAI Texts additional data...");
|
||||
if (result)
|
||||
{
|
||||
barGoLink bar(result->GetRowCount());
|
||||
uint32 count = 0;
|
||||
|
||||
do
|
||||
{
|
||||
bar.step();
|
||||
Field* fields = result->Fetch();
|
||||
StringTextData temp;
|
||||
|
||||
int32 i = fields[0].GetInt32();
|
||||
temp.SoundId = fields[1].GetInt32();
|
||||
temp.Type = fields[2].GetInt32();
|
||||
temp.Language = fields[3].GetInt32();
|
||||
temp.Emote = fields[4].GetInt32();
|
||||
|
||||
if (i >= 0)
|
||||
{
|
||||
error_db_log("TSCR: Entry %i in table `creature_ai_texts` is not a negative value.",i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (i <= TEXT_SOURCE_RANGE)
|
||||
{
|
||||
error_db_log("TSCR: Entry %i in table `creature_ai_texts` is out of accepted entry range for table.",i);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (temp.SoundId)
|
||||
{
|
||||
if (!GetSoundEntriesStore()->LookupEntry(temp.SoundId))
|
||||
error_db_log("TSCR: Entry %i in table `creature_ai_texts` has soundId %u but sound does not exist.",i,temp.SoundId);
|
||||
}
|
||||
|
||||
if (!GetLanguageDescByID(temp.Language))
|
||||
error_db_log("TSCR: Entry %i in table `creature_ai_texts` using Language %u but Language does not exist.",i,temp.Language);
|
||||
|
||||
if (temp.Type > CHAT_TYPE_ZONE_YELL)
|
||||
error_db_log("TSCR: Entry %i in table `creature_ai_texts` has Type %u but this Chat Type does not exist.",i,temp.Type);
|
||||
|
||||
TextMap[i] = temp;
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
||||
outstring_log("");
|
||||
outstring_log(">> TSCR: Loaded %u additional EventAI Texts data.", count);
|
||||
}else
|
||||
{
|
||||
barGoLink bar(1);
|
||||
bar.step();
|
||||
outstring_log("");
|
||||
outstring_log(">> Loaded 0 additional EventAI Texts data. DB table `creature_ai_texts` is empty.");
|
||||
}
|
||||
|
||||
// Load Script Text
|
||||
outstring_log("TSCR: Loading Script Texts...");
|
||||
LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2));
|
||||
|
||||
Reference in New Issue
Block a user