Core/Creature: Profession trainer fixes (PR #22904)

Closes #22903

(cherry picked from commit 19791a35df)
This commit is contained in:
Ghaster
2019-01-03 16:52:22 +01:00
committed by Shauren
parent c4eed6561c
commit f4d029b952

View File

@@ -115,6 +115,16 @@ namespace Trainer
if (trainerSpellInfo->IsPrimaryProfessionFirstRank() && !player->GetFreePrimaryProfessionPoints())
return false;
for (SpellEffectInfo const& effect : trainerSpellInfo->GetEffects())
{
if (!effect.IsEffect(SPELL_EFFECT_LEARN_SPELL))
continue;
SpellInfo const* learnedSpellInfo = sSpellMgr->GetSpellInfo(effect.TriggerSpell, DIFFICULTY_NONE);
if (learnedSpellInfo && learnedSpellInfo->IsPrimaryProfessionFirstRank() && !player->GetFreePrimaryProfessionPoints())
return false;
}
return true;
}