aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-08 16:39:22 -0500
committermegamage <none@none>2009-04-08 16:39:22 -0500
commit618e9d600d81fa979ac582bb66454c45afb6404e (patch)
treeaa2833caeb025ee36df8fc66956e27873ac9f69d /src
parent6ebb3d0ddddff5516d93a73c889d45b5286e2cee (diff)
[7639] Correctly fixed error spam, revert [7637]. Thx to vladimir Author: Triply
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/AchievementMgr.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp
index 776ff9ebdc7..3bf36d1f0cf 100644
--- a/src/game/AchievementMgr.cpp
+++ b/src/game/AchievementMgr.cpp
@@ -673,12 +673,20 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
// AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
if(!miscvalue1)
continue;
- BattleGround* bg = GetPlayer()->GetBattleGround();
- if(!bg || !bg->isArena())
- continue;
- //bg is arena so bg->GetArenaType() will return correct value
- uint8 slot = ArenaTeam::GetSlotByType(bg->GetArenaType());
- if(slot >= MAX_ARENA_SLOT || achievIdByArenaSlot[slot] != achievement->ID)
+ // skip wrong arena achievements, if not achievIdByArenaSlot then normal total death counter
+ bool notfit = false;
+ for(int i = 0; i < MAX_ARENA_SLOT; ++i)
+ {
+ if(achievIdByArenaSlot[i] == achievement->ID)
+ {
+ BattleGround* bg = GetPlayer()->GetBattleGround();
+ if(!bg || !bg->isArena() || ArenaTeam::GetSlotByType(bg->GetArenaType()) != i)
+ notfit = true;
+
+ break;
+ }
+ }
+ if(notfit)
continue;
SetCriteriaProgress(achievementCriteria, 1, PROGRESS_ACCUMULATE);