mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 18:36:31 +01:00
*Update to Mangos 7151.
--HG-- branch : trunk
This commit is contained in:
@@ -907,14 +907,30 @@ AchievementCriteriaEntryList const& AchievementGlobalMgr::GetAchievementCriteria
|
||||
|
||||
void AchievementGlobalMgr::LoadAchievementCriteriaList()
|
||||
{
|
||||
if(sAchievementCriteriaStore.GetNumRows()==0)
|
||||
{
|
||||
barGoLink bar(1);
|
||||
bar.step();
|
||||
|
||||
sLog.outString("");
|
||||
sLog.outErrorDb(">> Loaded 0 achievement criteria.");
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar( sAchievementCriteriaStore.GetNumRows() );
|
||||
for (uint32 entryId = 0; entryId<sAchievementCriteriaStore.GetNumRows(); entryId++)
|
||||
{
|
||||
bar.step();
|
||||
|
||||
AchievementCriteriaEntry const* criteria = sAchievementCriteriaStore.LookupEntry(entryId);
|
||||
if(!criteria)
|
||||
continue;
|
||||
|
||||
m_AchievementCriteriasByType[criteria->requiredType].push_back(criteria);
|
||||
}
|
||||
|
||||
sLog.outString();
|
||||
sLog.outErrorDb(">> Loaded 0 achievement criteria.",m_AchievementCriteriasByType->size());
|
||||
}
|
||||
|
||||
|
||||
@@ -923,15 +939,27 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
|
||||
QueryResult *result = CharacterDatabase.Query("SELECT achievement FROM character_achievement GROUP BY achievement");
|
||||
|
||||
if(!result)
|
||||
return;
|
||||
{
|
||||
barGoLink bar(1);
|
||||
bar.step();
|
||||
|
||||
sLog.outString("");
|
||||
sLog.outString(">> Loaded 0 realm completed achievements . DB table `character_achievement` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
barGoLink bar(result->GetRowCount());
|
||||
do
|
||||
{
|
||||
bar.step();
|
||||
Field *fields = result->Fetch();
|
||||
m_allCompletedAchievements.insert(fields[0].GetUInt32());
|
||||
} while(result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
||||
sLog.outString("");
|
||||
sLog.outString(">> Loaded %u realm completed achievements.",m_allCompletedAchievements.size());
|
||||
}
|
||||
|
||||
void AchievementGlobalMgr::LoadRewards()
|
||||
@@ -948,7 +976,7 @@ void AchievementGlobalMgr::LoadRewards()
|
||||
bar.step();
|
||||
|
||||
sLog.outString("");
|
||||
sLog.outString(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
|
||||
sLog.outErrorDb(">> Loaded 0 achievement rewards. DB table `achievement_reward` is empty.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -956,9 +984,9 @@ void AchievementGlobalMgr::LoadRewards()
|
||||
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
bar.step();
|
||||
|
||||
Field *fields = result->Fetch();
|
||||
uint32 entry = fields[0].GetUInt32();
|
||||
if (!sAchievementStore.LookupEntry(entry))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user