aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/InstanceData.cpp10
-rw-r--r--src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp14
2 files changed, 9 insertions, 15 deletions
diff --git a/src/game/InstanceData.cpp b/src/game/InstanceData.cpp
index 3ff804818ea..67dafee5a5e 100644
--- a/src/game/InstanceData.cpp
+++ b/src/game/InstanceData.cpp
@@ -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
diff --git a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
index 82eda44bb58..e2fe94872ab 100644
--- a/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
+++ b/src/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp
@@ -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)