Skip to content

Commit

Permalink
Show quest icons at flightmaster npcs
Browse files Browse the repository at this point in the history
Signed-off-by: robinsch <robin.schriever.hude@web.de>
  • Loading branch information
robinsch authored and Fabi committed Jan 3, 2017
1 parent a8beea5 commit 634917f
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/game/Object.cpp
Expand Up @@ -589,6 +589,31 @@ void Object::BuildValuesUpdate(uint8 updatetype, ByteBuffer* data, UpdateMask* u
if (target->getClass() != CLASS_HUNTER)
appendValue &= ~UNIT_NPC_FLAG_STABLEMASTER;
}

if (appendValue & UNIT_NPC_FLAG_FLIGHTMASTER)
{
QuestRelationsMapBounds bounds = sObjectMgr.GetCreatureQuestRelationsMapBounds(((Creature*)this)->GetEntry());
for (QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{
Quest const* pQuest = sObjectMgr.GetQuestTemplate(itr->second);
if (target->CanSeeStartQuest(pQuest))
{
appendValue &= ~UNIT_NPC_FLAG_FLIGHTMASTER;
break;
}
}

bounds = sObjectMgr.GetCreatureQuestInvolvedRelationsMapBounds(((Creature*)this)->GetEntry());
for (QuestRelationsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
{
Quest const* pQuest = sObjectMgr.GetQuestTemplate(itr->second);
if (target->CanRewardQuest(pQuest, false))
{
appendValue &= ~UNIT_NPC_FLAG_FLIGHTMASTER;
break;
}
}
}
}

*data << uint32(appendValue);
Expand Down

0 comments on commit 634917f

Please sign in to comment.