mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[8741] Remove trainer npcflags for player that can not train from npc.
Tracking of class and profession trainer should then work as expected client side, but database still need to apply flag values based on trainer function. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
10a659a29a
commit
7b6f4accd1
2 changed files with 12 additions and 3 deletions
|
|
@ -633,8 +633,17 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
|
|||
// remove custom flag before sending
|
||||
uint32 appendValue = m_uint32Values[ index ] & ~UNIT_NPC_FLAG_GUARD;
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue