Skip to content

Commit 6370d9a

Browse files
Schmoozerdxfurry
authored andcommitted
[s1917] Note ingame if gossip conditions are ignored because of GM mode
(based on commit [12386] - 5ece4bc)
1 parent ca18d1c commit 6370d9a

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/game/Player.cpp

+13-3
Original file line numberDiff line numberDiff line change
@@ -12230,14 +12230,17 @@ void Player::PrepareGossipMenu(WorldObject* pSource, uint32 menuId)
1223012230
for (GossipMenuItemsMap::const_iterator itr = pMenuItemBounds.first; itr != pMenuItemBounds.second; ++itr)
1223112231
{
1223212232
bool hasMenuItem = true;
12233+
bool isGMSkipConditionCheck = false;
1223312234

12234-
if (!isGameMaster()) // Let GM always see menu items regardless of conditions
12235+
if (itr->second.conditionId && !sObjectMgr.IsPlayerMeetToCondition(itr->second.conditionId, this, GetMap(), pSource, CONDITION_FROM_GOSSIP_OPTION))
1223512236
{
12236-
if (itr->second.conditionId && !sObjectMgr.IsPlayerMeetToCondition(itr->second.conditionId, this, GetMap(), pSource, CONDITION_FROM_GOSSIP_OPTION))
12237+
if (isGameMaster()) // Let GM always see menu items regardless of conditions
12238+
isGMSkipConditionCheck = true;
12239+
else
1223712240
{
1223812241
if (itr->second.option_id == GOSSIP_OPTION_QUESTGIVER)
1223912242
canSeeQuests = false;
12240-
continue;
12243+
continue; // Skip this option
1224112244
}
1224212245
}
1224312246

@@ -12352,6 +12355,13 @@ void Player::PrepareGossipMenu(WorldObject* pSource, uint32 menuId)
1235212355
}
1235312356
}
1235412357

12358+
if (isGMSkipConditionCheck)
12359+
{
12360+
strOptionText.append(" (");
12361+
strOptionText.append(GetSession()->GetMangosString(LANG_GM_ON));
12362+
strOptionText.append(")");
12363+
}
12364+
1235512365
pMenu->GetGossipMenu().AddMenuItem(itr->second.option_icon, strOptionText, 0, itr->second.option_id, strBoxText, itr->second.box_money, itr->second.box_coded);
1235612366
pMenu->GetGossipMenu().AddGossipMenuItemData(itr->second.action_menu_id, itr->second.action_poi_id, itr->second.action_script_id);
1235712367
}

src/shared/revision_nr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#ifndef __REVISION_NR_H__
22
#define __REVISION_NR_H__
3-
#define REVISION_NR "1916"
3+
#define REVISION_NR "1917"
44
#endif // __REVISION_NR_H__

0 commit comments

Comments
 (0)