aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorclick <none@none>2010-05-13 19:06:20 +0200
committerclick <none@none>2010-05-13 19:06:20 +0200
commitc8e648e18e353bfbef37533f3148c7af620e94d4 (patch)
tree75244e27e525371900231a700c2f615307960695
parentf286f583fc211582d5dcf44648f300dc880040cc (diff)
Make questgivers automatically inform of quests in their gossipmenu when available - removes need of extra gossip option to show quests
Fix by Liberate (made for Malcrom so he stops complaining) --HG-- branch : trunk
-rw-r--r--src/game/Player.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 454e943a61a..b0b49b4f3a4 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -13209,6 +13209,20 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
if (pMenuItemBounds.first == pMenuItemBounds.second && menuId == GetDefaultGossipMenuForSource(pSource))
pMenuItemBounds = objmgr.GetGossipMenuItemsMapBounds(0);
+ uint32 npcflags = 0;
+ Creature *pCreature = NULL;
+ GameObject *pGo = NULL;
+
+ if (pSource->GetTypeId() == TYPEID_UNIT)
+ {
+ pCreature = pSource->ToCreature();
+ npcflags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS);
+ if (npcflags & UNIT_NPC_FLAG_QUESTGIVER)
+ PrepareQuestMenu(pSource->GetGUID());
+ }
+ else if (pSource->GetTypeId() == TYPEID_GAMEOBJECT)
+ pGo = (GameObject*)pSource;
+
for (GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
{
bool bCanTalk = true;
@@ -13224,19 +13238,11 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
if (pSource->GetTypeId() == TYPEID_UNIT)
{
- Creature *pCreature = pSource->ToCreature();
-
- uint32 npcflags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS);
-
if (!(itr->second.npc_option_npcflag & npcflags))
continue;
switch(itr->second.option_id)
{
- case GOSSIP_OPTION_QUESTGIVER:
- PrepareQuestMenu(pSource->GetGUID());
- bCanTalk = false;
- break;
case GOSSIP_OPTION_ARMORER:
bCanTalk = false; // added in special mode
break;