Core/Creatures: added helper to check if a class trainer can train a player and use it in various places to get rid of multiple checks

This commit is contained in:
Ovahlord committed 2019-12-13 17:49:16 +01:00
1 parent de371675e6
commit 108316ba28
4 files changed
+9 -5

No files matched your search

+1 -1
View File
@@ -14504,7 +14504,7 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
if (!target->CanSeeSpellClickOn(creature))
appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
if (target->IsPlayer() && !creature->isCanTrainingAndResetTalentsOf(target->ToPlayer()))
if (target->IsPlayer() && !creature->IsClassTrainerOf(target->ToPlayer()))
appendValue &= ~UNIT_NPC_FLAG_TRAINER_CLASS;
}