Core/Loot: implemented a custom server config setting to enable or disable AE loot

Port From (https://github.com/TrinityCore/TrinityCore/commit/ccc083593af16f505263f889712f46f9382bb588)
This commit is contained in:
hondacrx
2024-02-06 15:32:46 -05:00
parent d1ad9f662e
commit a1a78bf8b0
4 changed files with 18 additions and 2 deletions
+6 -2
View File
@@ -217,8 +217,12 @@ namespace Game
GetPlayer().RemoveAurasWithInterruptFlags(SpellAuraInterruptFlags.Looting);
List<Creature> corpses = new();
CreatureListSearcher searcher = new(_player, corpses, check);
Cell.VisitGridObjects(_player, searcher, AELootCreatureCheck.LootDistance);
bool aeLootEnabled = WorldConfig.GetBoolValue(WorldCfg.EnableAeLoot);
if (aeLootEnabled)
{
CreatureListSearcher searcher = new(_player, corpses, check);
Cell.VisitGridObjects(_player, searcher, AELootCreatureCheck.LootDistance);
}
if (!corpses.Empty())
SendPacket(new AELootTargets((uint)corpses.Count + 1));