Skip to content

Commit

Permalink
Fix learn command giving high lvl talents
Browse files Browse the repository at this point in the history
  • Loading branch information
celguar committed Jan 23, 2023
1 parent 023730c commit c9b6a32
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23498,12 +23498,13 @@ void Player::learnClassLevelSpells(bool includeHighLevelQuestRewards)
if (!tSpell)
continue;

uint32 reqLevel = 0;

// skip wrong class/race skills
if (!IsSpellFitByClassAndRace(tSpell->learnedSpell))
// skip wrong class/race skills
if (!IsSpellFitByClassAndRace(tSpell->learnedSpell))
continue;

uint32 reqLevel = 0;
IsSpellFitByClassAndRace(tSpell->learnedSpell, &reqLevel);

if (tSpell->conditionId && !sObjectMgr.IsConditionSatisfied(tSpell->conditionId, this, GetMap(), this, CONDITION_FROM_TRAINER))
continue;

Expand Down Expand Up @@ -23564,10 +23565,6 @@ void Player::learnClassLevelSpells(bool includeHighLevelQuestRewards)
}
}

// skip wrong class/race skills
if (!IsSpellFitByClassAndRace(tSpell->learnedSpell))
continue;

// skip broken spells
if (!SpellMgr::IsSpellValid(proto, this, false))
continue;
Expand Down

0 comments on commit c9b6a32

Please sign in to comment.