Skip to content

Commit

Permalink
[12386] Note ingame if gossip conditions are ignored because of GM mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Schmoozerd committed Mar 1, 2013
1 parent e3136c2 commit 5ece4bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions src/game/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13185,14 +13185,17 @@ void Player::PrepareGossipMenu(WorldObject* pSource, uint32 menuId)
for (GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
{
bool hasMenuItem = true;
bool isGMSkipConditionCheck = false;

if (!isGameMaster()) // Let GM always see menu items regardless of conditions
if (itr->second.conditionId && !sObjectMgr.IsPlayerMeetToCondition(itr->second.conditionId, this, GetMap(), pSource, CONDITION_FROM_GOSSIP_OPTION))
{
if (itr->second.conditionId && !sObjectMgr.IsPlayerMeetToCondition(itr->second.conditionId, this, GetMap(), pSource, CONDITION_FROM_GOSSIP_OPTION))
if (isGameMaster()) // Let GM always see menu items regardless of conditions
isGMSkipConditionCheck = true;
else
{
if (itr->second.option_id == GOSSIP_OPTION_QUESTGIVER)
canSeeQuests = false;
continue;
continue; // Skip this option
}
}

Expand Down Expand Up @@ -13320,6 +13323,13 @@ void Player::PrepareGossipMenu(WorldObject* pSource, uint32 menuId)
}
}

if (isGMSkipConditionCheck)
{
strOptionText.append(" (");
strOptionText.append(GetSession()->GetMangosString(LANG_GM_ON));
strOptionText.append(")");
}

pMenu->GetGossipMenu().AddMenuItem(itr->second.option_icon, strOptionText, 0, itr->second.option_id, strBoxText, itr->second.box_money, itr->second.box_coded);
pMenu->GetGossipMenu().AddGossipMenuItemData(itr->second.action_menu_id, itr->second.action_poi_id, itr->second.action_script_id);
}
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "12385"
#define REVISION_NR "12386"
#endif // __REVISION_NR_H__

0 comments on commit 5ece4bc

Please sign in to comment.