mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
Remove trainer npcflags for player that can not train from npc. by NoFantasy
--HG-- branch : trunk
This commit is contained in:
@@ -527,8 +527,17 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
||||
// remove custom flag before sending
|
||||
uint32 appendValue = m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP);
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT && !target->canSeeSpellClickOn((Creature*)this))
|
||||
appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
|
||||
if (GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (!target->canSeeSpellClickOn((Creature*)this))
|
||||
appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK;
|
||||
|
||||
if (appendValue & UNIT_NPC_FLAG_TRAINER)
|
||||
{
|
||||
if (!((Creature*)this)->isCanTrainingOf(target, false))
|
||||
appendValue &= ~(UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_TRAINER_CLASS | UNIT_NPC_FLAG_TRAINER_PROFESSION);
|
||||
}
|
||||
}
|
||||
|
||||
*data << uint32(appendValue);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user