diff options
Diffstat (limited to 'src/game/InstanceData.cpp')
-rw-r--r-- | src/game/InstanceData.cpp | 10 |
1 files changed, 8 insertions, 2 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 |