aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrazom62 <none@none>2010-03-27 13:45:39 +0100
committerTrazom62 <none@none>2010-03-27 13:45:39 +0100
commit099ef2a9b6e2e1c4986878c15ce5758edba5a71c (patch)
tree7dedcc0e2460efc316554324ef0a1067b226361c /src
parenteedd43efa5b03eeb53f75d64edaddf7e25645998 (diff)
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
Diffstat (limited to 'src')
-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)