mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[8952] Use default gossip menu options if no options exist for "top level" menu.
Also not close gossip menu in cases where no action_menu_id is set. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
d604b0a120
commit
4ca8b0defc
5 changed files with 27 additions and 5 deletions
|
|
@ -12188,6 +12188,10 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
|||
|
||||
GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId);
|
||||
|
||||
// if default menuId and no menu options exist for this, use options from default options
|
||||
if (pMenuItemBounds.first == pMenuItemBounds.second && menuId == GetDefaultGossipMenuForSource(pSource))
|
||||
pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(0);
|
||||
|
||||
for(GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
|
||||
{
|
||||
bool bCanTalk = true;
|
||||
|
|
@ -12405,10 +12409,6 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me
|
|||
PrepareGossipMenu(pSource, pMenuData.m_gAction_menu);
|
||||
SendPreparedGossip(pSource);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerTalkClass->CloseGossip();
|
||||
}
|
||||
|
||||
if (pMenuData.m_gAction_poi)
|
||||
PlayerTalkClass->SendPointOfInterest(pMenuData.m_gAction_poi);
|
||||
|
|
@ -12519,6 +12519,16 @@ uint32 Player::GetGossipTextId(uint32 menuId)
|
|||
return textId;
|
||||
}
|
||||
|
||||
uint32 Player::GetDefaultGossipMenuForSource(WorldObject *pSource)
|
||||
{
|
||||
if (pSource->GetTypeId() == TYPEID_UNIT)
|
||||
return ((Creature*)pSource)->GetCreatureInfo()->GossipMenuId;
|
||||
else if (pSource->GetTypeId() == TYPEID_GAMEOBJECT)
|
||||
return((GameObject*)pSource)->GetGOInfo()->GetGossipMenuId();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
/*** QUEST SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue