mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Loot: implemented a custom server config setting to enable or disable AE loot (#29602)
This config primarily serves as a means to reduce potential code differences between the master and classic branches as now we no longer have to meddle with code
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
class AELootCreatureCheck
|
||||
{
|
||||
@@ -232,9 +233,13 @@ void WorldSession::HandleLootOpcode(WorldPackets::Loot::LootUnit& packet)
|
||||
|
||||
GetPlayer()->RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags::Looting);
|
||||
|
||||
bool const aeLootEnabled = sWorld->getBoolConfig(CONFIG_ENABLE_AE_LOOT);
|
||||
std::vector<Creature*> corpses;
|
||||
Trinity::CreatureListSearcher<AELootCreatureCheck> searcher(_player, corpses, check);
|
||||
Cell::VisitGridObjects(_player, searcher, AELootCreatureCheck::LootDistance);
|
||||
if (aeLootEnabled)
|
||||
{
|
||||
Trinity::CreatureListSearcher<AELootCreatureCheck> searcher(_player, corpses, check);
|
||||
Cell::VisitGridObjects(_player, searcher, AELootCreatureCheck::LootDistance);
|
||||
}
|
||||
|
||||
if (!corpses.empty())
|
||||
SendPacket(WorldPackets::Loot::AELootTargets(uint32(corpses.size() + 1)).Write());
|
||||
|
||||
@@ -1721,6 +1721,9 @@ void World::LoadConfigSettings(bool reload)
|
||||
// Specifies if IP addresses can be logged to the database
|
||||
m_bool_configs[CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE] = sConfigMgr->GetBoolDefault("AllowLoggingIPAddressesInDatabase", true, true);
|
||||
|
||||
// Enable AE loot
|
||||
m_bool_configs[CONFIG_ENABLE_AE_LOOT] = sConfigMgr->GetBoolDefault("Loot.EnableAELoot", true);
|
||||
|
||||
// call ScriptMgr if we're reloading the configuration
|
||||
if (reload)
|
||||
sScriptMgr->OnConfigLoad(reload);
|
||||
|
||||
@@ -197,6 +197,7 @@ enum WorldBoolConfigs
|
||||
CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE,
|
||||
CONFIG_CHARACTER_CREATING_DISABLE_ALLIED_RACE_ACHIEVEMENT_REQUIREMENT,
|
||||
CONFIG_BATTLEGROUNDMAP_LOAD_GRIDS,
|
||||
CONFIG_ENABLE_AE_LOOT,
|
||||
BOOL_CONFIG_VALUE_COUNT
|
||||
};
|
||||
|
||||
|
||||
@@ -3554,6 +3554,14 @@ Creature.CheckInvalidPosition = 0
|
||||
|
||||
GameObject.CheckInvalidPosition = 0
|
||||
|
||||
#
|
||||
# Loot.EnableAELoot
|
||||
# Description: Enables AE loot which will allow looting all creatures within a 30 yards radius at once
|
||||
# Default: 1 - (AE loot enabled)
|
||||
# 0 - (AE loot disabled)
|
||||
|
||||
Loot.EnableAELoot = 1
|
||||
|
||||
#
|
||||
###################################################################################################
|
||||
|
||||
|
||||
Reference in New Issue
Block a user