fix(Core/Creatures): Fixed displaying trainer npcflags that are not valid to player. (#4848)

This commit is contained in:
UltraNix
2021-03-21 15:18:41 +01:00
committed by GitHub
parent 485f7e7639
commit 6c7cc1690f
4 changed files with 52 additions and 0 deletions

View File

@@ -19844,6 +19844,11 @@ void Unit::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target)
if (!target->CanSeeSpellClickOn(creature))
appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
if (!creature->IsValidTrainerForPlayer(target, &appendValue))
{
appendValue &= ~UNIT_NPC_FLAG_TRAINER;
}
}
fieldBuffer << uint32(appendValue);