From f14c0e319f9502e0572aede1c68df89edbfec31e Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Thu, 20 May 2010 09:28:36 +0200 Subject: [PATCH] [9941] Add additional check for UNIT_NPC_FLAG_GOSSIP before using TalkedToCreature Signed-off-by: NoFantasy --- src/game/Player.cpp | 13 ++++++++----- src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index dd43dc533..55fee16a2 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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) - TalkedToCreature(((Creature*)pSource)->GetEntry(), ((Creature*)pSource)->GetGUID()); + { + 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()) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index aae7db8f4..60468c070 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "9940" + #define REVISION_NR "9941" #endif // __REVISION_NR_H__