mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[11213] Always PrepareQuestMenu in PrepareGossipMenu when no conditions are set
This will make life easier for DB devs, as GOSSIP_OPTION_QUESTGIVER no longer need to be filled in to gossip_menu_option table. Menu option with GOSSIP_OPTION_QUESTGIVER and conditions will work as before. Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
a5d83cea08
commit
ceaca46604
2 changed files with 21 additions and 6 deletions
|
|
@ -12858,8 +12858,11 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
||||||
|
|
||||||
GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId);
|
GossipMenuItemsMapBounds pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(menuId);
|
||||||
|
|
||||||
// if default menuId and no menu options exist for this, use options from default options
|
// prepares quest menu when true
|
||||||
if (pMenuItemBounds.first == pMenuItemBounds.second && menuId == GetDefaultGossipMenuForSource(pSource))
|
bool canSeeQuests = menuId == GetDefaultGossipMenuForSource(pSource);
|
||||||
|
|
||||||
|
// if canSeeQuests (the default, top level menu) and no menu options exist for this, use options from default options
|
||||||
|
if (pMenuItemBounds.first == pMenuItemBounds.second && canSeeQuests)
|
||||||
pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(0);
|
pMenuItemBounds = sObjectMgr.GetGossipMenuItemsMapBounds(0);
|
||||||
|
|
||||||
bool canTalkToCredit = pSource->GetTypeId() == TYPEID_UNIT;
|
bool canTalkToCredit = pSource->GetTypeId() == TYPEID_UNIT;
|
||||||
|
|
@ -12869,13 +12872,25 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
||||||
bool hasMenuItem = true;
|
bool hasMenuItem = true;
|
||||||
|
|
||||||
if (itr->second.cond_1 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_1))
|
if (itr->second.cond_1 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_1))
|
||||||
|
{
|
||||||
|
if (itr->second.option_id == GOSSIP_OPTION_QUESTGIVER)
|
||||||
|
canSeeQuests = false;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (itr->second.cond_2 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_2))
|
if (itr->second.cond_2 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_2))
|
||||||
|
{
|
||||||
|
if (itr->second.option_id == GOSSIP_OPTION_QUESTGIVER)
|
||||||
|
canSeeQuests = false;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (itr->second.cond_3 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_3))
|
if (itr->second.cond_3 && !sObjectMgr.IsPlayerMeetToCondition(this, itr->second.cond_3))
|
||||||
|
{
|
||||||
|
if (itr->second.option_id == GOSSIP_OPTION_QUESTGIVER)
|
||||||
|
canSeeQuests = false;
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (pSource->GetTypeId() == TYPEID_UNIT)
|
if (pSource->GetTypeId() == TYPEID_UNIT)
|
||||||
{
|
{
|
||||||
|
|
@ -12893,7 +12908,6 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
||||||
canTalkToCredit = false;
|
canTalkToCredit = false;
|
||||||
break;
|
break;
|
||||||
case GOSSIP_OPTION_QUESTGIVER:
|
case GOSSIP_OPTION_QUESTGIVER:
|
||||||
PrepareQuestMenu(pSource->GetObjectGuid());
|
|
||||||
hasMenuItem = false;
|
hasMenuItem = false;
|
||||||
break;
|
break;
|
||||||
case GOSSIP_OPTION_ARMORER:
|
case GOSSIP_OPTION_ARMORER:
|
||||||
|
|
@ -12970,8 +12984,6 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
||||||
switch(itr->second.option_id)
|
switch(itr->second.option_id)
|
||||||
{
|
{
|
||||||
case GOSSIP_OPTION_QUESTGIVER:
|
case GOSSIP_OPTION_QUESTGIVER:
|
||||||
if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER)
|
|
||||||
PrepareQuestMenu(pSource->GetObjectGuid());
|
|
||||||
hasMenuItem = false;
|
hasMenuItem = false;
|
||||||
break;
|
break;
|
||||||
case GOSSIP_OPTION_GOSSIP:
|
case GOSSIP_OPTION_GOSSIP:
|
||||||
|
|
@ -13010,6 +13022,9 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (canSeeQuests)
|
||||||
|
PrepareQuestMenu(pSource->GetObjectGuid());
|
||||||
|
|
||||||
if (canTalkToCredit)
|
if (canTalkToCredit)
|
||||||
{
|
{
|
||||||
if (pSource->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
|
if (pSource->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP))
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11212"
|
#define REVISION_NR "11213"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue