[9941] Add additional check for UNIT_NPC_FLAG_GOSSIP before using TalkedToCreature

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-05-20 09:28:36 +02:00
parent 47186c05ec
commit f14c0e319f
2 changed files with 9 additions and 6 deletions

View file

@ -12590,6 +12590,10 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
switch(itr->second.option_id)
{
case GOSSIP_OPTION_GOSSIP:
if (itr->second.action_menu_id) // has sub menu, so do not "talk" with this NPC yet
canTalkToCredit = false;
break;
case GOSSIP_OPTION_QUESTGIVER:
PrepareQuestMenu(pSource->GetGUID());
hasMenuItem = false;
@ -12635,10 +12639,6 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
if (getClass() != CLASS_HUNTER)
hasMenuItem = false;
break;
case GOSSIP_OPTION_GOSSIP:
if (itr->second.action_menu_id) // has sub menu, so do not "talk" with this NPC yet
canTalkToCredit = false;
break;
case GOSSIP_OPTION_SPIRITGUIDE:
case GOSSIP_OPTION_INNKEEPER:
case GOSSIP_OPTION_BANKER:
@ -12702,7 +12702,10 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
}
if (canTalkToCredit)
{
if (pSource->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
TalkedToCreature(((Creature*)pSource)->GetEntry(), ((Creature*)pSource)->GetGUID());
}
// some gossips aren't handled in normal way ... so we need to do it this way .. TODO: handle it in normal way ;-)
/*if (pMenu->Empty())

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9940"
#define REVISION_NR "9941"
#endif // __REVISION_NR_H__