Core/Chat: Added option to allow 5-man parties to use raid warnings

Closes #17889

* Added parentheses to satisfy TravisCI.

* Adjusted to a boolean config option instead of an integer.
This commit is contained in:
Alan Deutscher
2017-01-07 04:03:03 -08:00
committed by Aokromes
parent b1fa8ff028
commit fc06465b17
4 changed files with 13 additions and 1 deletions

View File

@@ -412,7 +412,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
case CHAT_MSG_RAID_WARNING:
{
Group* group = GetPlayer()->GetGroup();
if (!group || !group->isRaidGroup() || !(group->IsLeader(GetPlayer()->GetGUID()) || group->IsAssistant(GetPlayer()->GetGUID())) || group->isBGGroup())
if (!group || (group->isRaidGroup() && !(group->IsLeader(GetPlayer()->GetGUID()) || group->IsAssistant(GetPlayer()->GetGUID()))) || group->isBGGroup() || !sWorld->getBoolConfig(CONFIG_CHAT_PARTY_RAID_WARNINGS))
return;
sScriptMgr->OnPlayerChat(GetPlayer(), type, lang, msg, group);

View File

@@ -1349,6 +1349,9 @@ void World::LoadConfigSettings(bool reload)
// prevent character rename on character customization
m_bool_configs[CONFIG_PREVENT_RENAME_CUSTOMIZATION] = sConfigMgr->GetBoolDefault("PreventRenameCharacterOnCustomization", false);
// Allow 5-man parties to use raid warnings
m_bool_configs[CONFIG_CHAT_PARTY_RAID_WARNINGS] = sConfigMgr->GetBoolDefault("PartyRaidWarnings", false);
// call ScriptMgr if we're reloading the configuration
if (reload)
sScriptMgr->OnConfigLoad(reload);

View File

@@ -113,6 +113,7 @@ enum WorldBoolConfigs
CONFIG_WEATHER,
CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL,
CONFIG_QUEST_IGNORE_RAID,
CONFIG_CHAT_PARTY_RAID_WARNINGS,
CONFIG_DETECT_POS_COLLISION,
CONFIG_RESTRICTED_LFG_CHANNEL,
CONFIG_CHAT_FAKE_MESSAGE_PREVENTING,

View File

@@ -1793,6 +1793,14 @@ PreserveCustomChannels = 1
PreserveCustomChannelDuration = 14
#
# PartyRaidWarnings
# Description: Allow any user to use raid warnings when in a 5-man party.
# Default: 0 - (Disabled, Blizzlike)
# 1 - (Enabled)
PartyRaidWarnings = 0
#
###################################################################################################