*Fix a bug that event ai text is loaded twice.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-17 17:46:47 -05:00
parent 5784d03121
commit cbc375b895

View File

@@ -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));