Core/Objects: Unify Searcher classes into one common implementation
Port From (https://github.com/TrinityCore/TrinityCore/commit/261eb201bf107cef441d9b075e8f23bf0edfbaf0) Port From (https://github.com/TrinityCore/TrinityCore/commit/526b16fea41fb69a302fdebe8a727e175949f04b) Port From (https://github.com/TrinityCore/TrinityCore/commit/8b7dce6521323e788ebf28297ec941a6f9bf876f) Port From (https://github.com/TrinityCore/TrinityCore/commit/5334467f493eb16141f4ad0bce956bc3e19244a0) Port From (https://github.com/TrinityCore/TrinityCore/commit/1e7725c15b149baaf96731231239769e482ec2ed) Port From (https://github.com/TrinityCore/TrinityCore/commit/21712f475383f6f3fae107706f5de5195f75b760)
This commit is contained in:
@@ -5239,17 +5239,15 @@ namespace Game.Spells
|
||||
if (unitTarget == null)
|
||||
return;
|
||||
|
||||
List<WorldObject> objs = new();
|
||||
ObjectEntryAndPrivateOwnerIfExistsCheck check = new(unitTarget.GetGUID(), (uint)effectInfo.MiscValue);
|
||||
WorldObjectListSearcher checker = new(unitTarget, objs, check, GridMapTypeMask.Conversation);
|
||||
Cell.VisitGridObjects(unitTarget, checker, 100.0f);
|
||||
|
||||
foreach (WorldObject obj in objs)
|
||||
var check = new ObjectEntryAndPrivateOwnerIfExistsCheck(unitTarget.GetGUID(), (uint)effectInfo.MiscValue);
|
||||
IDoWork<Conversation> work = conversation =>
|
||||
{
|
||||
Conversation convo = obj.ToConversation();
|
||||
if (convo != null)
|
||||
convo.Remove();
|
||||
}
|
||||
if (check.Invoke(conversation))
|
||||
conversation.Remove();
|
||||
};
|
||||
|
||||
ConversationWorker worker = new(unitTarget, work);
|
||||
Cell.VisitGridObjects(unitTarget, worker, 100.0f);
|
||||
}
|
||||
|
||||
[SpellEffectHandler(SpellEffectName.AddGarrisonFollower)]
|
||||
|
||||
Reference in New Issue
Block a user