Core/Trainer: do not send the level requirement for class trainer spells when the player has fulfilled the level requirement to match sniff behaivior

This commit is contained in:
Ovahlord
2020-01-14 01:06:32 +01:00
parent 3e373b132e
commit 175282fbb6

View File

@@ -45,6 +45,7 @@ namespace Trainer
trainerList.TrainerID = _trainerId;
trainerList.Greeting = GetGreeting(locale);
trainerList.Spells.reserve(_spells.size());
for (Spell const& trainerSpell : _spells)
{
if (!player->IsSpellFitByClassAndRace(trainerSpell.SpellId))
@@ -68,7 +69,10 @@ namespace Trainer
trainerListSpell.SpellID = trainerSpell.SpellId;
trainerListSpell.Usable = AsUnderlyingType(GetSpellState(player, &trainerSpell));
trainerListSpell.MoneyCost = int32(trainerSpell.MoneyCost * reputationDiscount);
trainerListSpell.ReqLevel = trainerSpell.ReqLevel;
if (_type != Type::Class || (_type == Type::Class && player->getLevel() < trainerSpell.ReqLevel))
trainerListSpell.ReqLevel = trainerSpell.ReqLevel;
trainerListSpell.ReqSkillLine = trainerSpell.ReqSkillLine;
trainerListSpell.ReqSkillRank = trainerSpell.ReqSkillRank;
trainerListSpell.ProfessionDialog = primaryProfessionFirstRank;