Fix InstanceData::DoCompleteAchievement (and crash in AchievementMgr::CompletedAchievement).

Remove support of no longer existing achievement "The Party is Over". Thanks JuliuSZS.
Fixes issue #1318.

--HG--
branch : trunk
This commit is contained in:
Trazom62
2010-03-27 13:45:39 +01:00
parent eedd43efa5
commit 099ef2a9b6
2 changed files with 9 additions and 15 deletions
+8 -2
View File
@@ -313,13 +313,19 @@ void InstanceData::DoSendNotifyToInstance(const char *format, ...)
// Complete Achievement for all players in instance
void InstanceData::DoCompleteAchievement(uint32 achievement)
{
AchievementEntry const* AE = GetAchievementStore()->LookupEntry(achievement);
AchievementEntry const* pAE = GetAchievementStore()->LookupEntry(achievement);
Map::PlayerList const &PlayerList = instance->GetPlayers();
if (!pAE)
{
error_log("TSCR: DoCompleteAchievement called for not existing achievement %u", achievement);
return;
}
if (!PlayerList.isEmpty())
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player *pPlayer = i->getSource())
pPlayer->CompletedAchievement(AE);
pPlayer->CompletedAchievement(pAE);
}
// Update Achievement Criteria for all players in instance
@@ -47,10 +47,7 @@ enum Misc
};
#define DATA_SPHERE_ANGLE_OFFSET 0.7
#define DATA_GROUND_POSITION_Z 11.4
enum Achievements
{
ACHIEV_THE_PARTY_IS_OVER = 1861
};
enum Yells
{
SAY_AGGRO = -1619021,
@@ -262,16 +259,7 @@ struct boss_taldaramAI : public ScriptedAI
DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
{
pInstance->SetData(DATA_PRINCE_TALDARAM_EVENT, DONE);
if (IsHeroic())
{
Map::PlayerList const &players = pInstance->instance->GetPlayers();
if (players.getSize() < 5)
pInstance->DoCompleteAchievement(ACHIEV_THE_PARTY_IS_OVER);
}
}
}
void KilledUnit(Unit *victim)