Remove trainer npcflags for player that can not train from npc. by NoFantasy

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-19 18:29:09 +01:00
parent b7e20e385f
commit 5f0c623f8a
+10 -1
View File
@@ -527,9 +527,18 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
// remove custom flag before sending // remove custom flag before sending
uint32 appendValue = m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP); uint32 appendValue = m_uint32Values[ index ] & ~(UNIT_NPC_FLAG_GUARD + UNIT_NPC_FLAG_OUTDOORPVP);
if (GetTypeId() == TYPEID_UNIT && !target->canSeeSpellClickOn((Creature*)this)) if (GetTypeId() == TYPEID_UNIT)
{
if (!target->canSeeSpellClickOn((Creature*)this))
appendValue &= ~UNIT_NPC_FLAG_SPELLCLICK; 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); *data << uint32(appendValue);
} }
else if (index == UNIT_FIELD_AURASTATE) else if (index == UNIT_FIELD_AURASTATE)