From a8e3c9ac4d351afc12b669fb85ee0ec4c89d3f1f Mon Sep 17 00:00:00 2001 From: Klark20 Date: Thu, 22 Dec 2011 12:03:15 +0100 Subject: [PATCH] [11873] Enable gossip_menu_option scripts for all gossip options Signed-off-by: Schmoozerd --- src/game/ObjectMgr.cpp | 6 ------ src/game/Player.cpp | 21 ++++++++++----------- src/shared/revision_nr.h | 2 +- 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index efde0a311..e2d0be3de 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -8754,12 +8754,6 @@ void ObjectMgr::LoadGossipMenuItems(std::set& gossipScriptSet) if (gMenuItem.action_script_id) { - if (gMenuItem.option_id != GOSSIP_OPTION_GOSSIP) - { - sLog.outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u but option_id is not GOSSIP_OPTION_GOSSIP, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_script_id); - continue; - } - if (sGossipScripts.find(gMenuItem.action_script_id) == sGossipScripts.end()) { sLog.outErrorDb("Table gossip_menu_option for menu %u, id %u have action_script_id %u that does not exist in `gossip_scripts`, ignoring", gMenuItem.menu_id, gMenuItem.id, gMenuItem.action_script_id); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index d8a040fc5..16a64a4e0 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -13165,7 +13165,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me GossipMenuItemData pMenuData = gossipmenu.GetItemData(gossipListId); - switch(gossipOptionId) + switch (gossipOptionId) { case GOSSIP_OPTION_GOSSIP: { @@ -13183,15 +13183,6 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me PlayerTalkClass->CloseGossip(); TalkedToCreature(pSource->GetEntry(), pSource->GetObjectGuid()); } - - if (pMenuData.m_gAction_script) - { - if (pSource->GetTypeId() == TYPEID_GAMEOBJECT) - GetMap()->ScriptsStart(sGossipScripts, pMenuData.m_gAction_script, this, pSource); - else if (pSource->GetTypeId() == TYPEID_UNIT) - GetMap()->ScriptsStart(sGossipScripts, pMenuData.m_gAction_script, pSource, this); - } - break; } case GOSSIP_OPTION_SPIRITHEALER: @@ -13263,6 +13254,14 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me break; } } + + if (pMenuData.m_gAction_script) + { + if (pSource->GetTypeId() == TYPEID_UNIT) + GetMap()->ScriptsStart(sGossipScripts, pMenuData.m_gAction_script, pSource, this); + else if (pSource->GetTypeId() == TYPEID_GAMEOBJECT) + GetMap()->ScriptsStart(sGossipScripts, pMenuData.m_gAction_script, this, pSource); + } } uint32 Player::GetGossipTextId(WorldObject *pSource) @@ -23118,4 +23117,4 @@ void Player::_fillGearScoreData(Item* item, GearScoreVec* gearScore, uint32& two default: break; } -} \ No newline at end of file +} diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c448201f2..ed7efa5a0 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 "11872" + #define REVISION_NR "11873" #endif // __REVISION_NR_H__