mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[8977] Not send npcflag stablemaster to non-hunter player
Also check for player class vs stablemaster flag in GetNPCIfCanInteractWith() Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
4f5ed57fc2
commit
f47492ad24
3 changed files with 13 additions and 1 deletions
|
|
@ -667,6 +667,12 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *
|
||||||
if (!((Creature*)this)->isCanTrainingOf(target, false))
|
if (!((Creature*)this)->isCanTrainingOf(target, false))
|
||||||
appendValue &= ~(UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_TRAINER_CLASS | UNIT_NPC_FLAG_TRAINER_PROFESSION);
|
appendValue &= ~(UNIT_NPC_FLAG_TRAINER | UNIT_NPC_FLAG_TRAINER_CLASS | UNIT_NPC_FLAG_TRAINER_PROFESSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appendValue & UNIT_NPC_FLAG_STABLEMASTER)
|
||||||
|
{
|
||||||
|
if (target->getClass() != CLASS_HUNTER)
|
||||||
|
appendValue &= ~UNIT_NPC_FLAG_STABLEMASTER;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*data << uint32(appendValue);
|
*data << uint32(appendValue);
|
||||||
|
|
|
||||||
|
|
@ -2088,6 +2088,12 @@ Creature* Player::GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask)
|
||||||
if (npcflagmask && !unit->HasFlag( UNIT_NPC_FLAGS, npcflagmask ))
|
if (npcflagmask && !unit->HasFlag( UNIT_NPC_FLAGS, npcflagmask ))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
if (npcflagmask == UNIT_NPC_FLAG_STABLEMASTER)
|
||||||
|
{
|
||||||
|
if (getClass() != CLASS_HUNTER)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// if a dead unit should be able to talk - the creature must be alive and have special flags
|
// if a dead unit should be able to talk - the creature must be alive and have special flags
|
||||||
if (!unit->isAlive())
|
if (!unit->isAlive())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8976"
|
#define REVISION_NR "8977"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue