mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
feat(Core/Unit): NPCFlags helpers (#11286)
* cherry-pick commit (TrinityCore/TrinityCore@d611925) Co-Authored-By: Shauren <shauren.trinity@gmail.com>
This commit is contained in:
@@ -45,7 +45,7 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
|
||||
if (source->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
npcflags = source->GetUInt32Value(UNIT_NPC_FLAGS);
|
||||
npcflags = source->ToUnit()->GetNpcFlags();
|
||||
if (showQuests && npcflags & UNIT_NPC_FLAG_QUESTGIVER)
|
||||
PrepareQuestMenu(source->GetGUID());
|
||||
}
|
||||
@@ -215,7 +215,7 @@ void Player::SendPreparedGossip(WorldObject* source)
|
||||
if (source->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
// in case no gossip flag and quest menu not empty, open quest menu (client expect gossip menu with this flag)
|
||||
if (!source->ToCreature()->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) && !PlayerTalkClass->GetQuestMenu().Empty())
|
||||
if (!source->ToCreature()->HasNpcFlag(UNIT_NPC_FLAG_GOSSIP) && !PlayerTalkClass->GetQuestMenu().Empty())
|
||||
{
|
||||
SendPreparedQuest(source->GetGUID());
|
||||
return;
|
||||
@@ -259,7 +259,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
||||
|
||||
if (sWorld->getIntConfig(CONFIG_INSTANT_TAXI) == 2 && source->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (gossipOptionId == GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT && source->GetUInt32Value(UNIT_NPC_FLAGS) & UNIT_NPC_FLAG_FLIGHTMASTER)
|
||||
if (gossipOptionId == GOSSIP_ACTION_TOGGLE_INSTANT_FLIGHT && source->ToUnit()->GetNpcFlags() & UNIT_NPC_FLAG_FLIGHTMASTER)
|
||||
{
|
||||
ToggleInstantFlight();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user