aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 6d34202b4bc..937b92a47b1 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -2955,6 +2955,9 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
SpellLearnSkillNode const* spellLearnSkill = spellmgr.GetSpellLearnSkill(spell_id);
+ SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spell_id);
+ SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spell_id);
+
if(spellLearnSkill)
{
uint32 skill_value = GetPureSkillValue(spellLearnSkill->skill);
@@ -2973,9 +2976,6 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
else
{
// not ranked skills
- SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(spell_id);
- SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(spell_id);
-
for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
{
SkillLineEntry const *pSkill = sSkillLineStore.LookupEntry(_spell_idx->second->skillId);
@@ -3022,10 +3022,16 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen
}
}
- if(IsInWorld())
+ if(!GetSession()->PlayerLoading())
{
+ // not ranked skills
+ for(SkillLineAbilityMap::const_iterator _spell_idx = lower; _spell_idx != upper; ++_spell_idx)
+ {
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LINE,_spell_idx->second->skillId);
+ GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS,_spell_idx->second->skillId);
+ }
+
GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL,spell_id);
- GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILLLINE_SPELLS,spell_id);
}
// return true (for send learn packet) only if spell active (in case ranked spells) and not replace old spell