Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Implemented ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL

Fixed typo in my previous commit
  • Loading branch information...
commit ea5bd623581fcf79e3ab90354bb1112828a9de44 1 parent a5ce729
@arrai arrai authored
Showing with 10 additions and 1 deletion.
  1. +7 −1 src/game/AchievementMgr.cpp
  2. +3 −0  src/game/Player.cpp
View
8 src/game/AchievementMgr.cpp
@@ -238,10 +238,14 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
// AchievementMgr::UpdateAchievementCriteria might also be called on login - skip in this case
if(!miscvalue1)
continue;
- if(GetPlayer()->GetMapID() != achievementCriteria->complete_battleground.mapID)
+ if(GetPlayer()->GetMapId() != achievementCriteria->complete_battleground.mapID)
continue;
SetCriteriaProgress(achievementCriteria, miscvalue1, true);
break;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
+ if(GetPlayer()->HasSpell(achievementCriteria->learn_spell.spellID))
+ SetCriteriaProgress(achievementCriteria, 1);
+ break;
}
if(IsCompletedCriteria(achievementCriteria))
@@ -312,6 +316,8 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_BATTLEGROUND:
// just used as a counter - return false
return false;
+ case ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL:
+ return progress->counter >= 1;
}
return false;
}
View
3  src/game/Player.cpp
@@ -2773,6 +2773,9 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool loading,
}
}
+ if(!loading)
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL);
+
// return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell
return active && !disabled && !superceded_old;
}
Please sign in to comment.
Something went wrong with that request. Please try again.