aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorn0n4m3 <none@none>2009-12-19 18:29:09 +0100
committern0n4m3 <none@none>2009-12-19 18:29:09 +0100
commit5f0c623f8aaa7a2fc8b6b8a51f35c4370ece7b86 (patch)
tree68d33f0d566f58e8f94d56fca5ef2b39e5bc14f4 /src/game
parentb7e20e385fbd1155e2c14c7a9cf9c204457e9180 (diff)
Remove trainer npcflags for player that can not train from npc. by NoFantasy
--HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Object.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp
index 1522f8db754..8727ab1d31f 100644
--- a/src/game/Object.cpp
+++ b/src/game/Object.cpp
@@ -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);
}