From 2e3920081f4f349a226ab5238cd983403e167656 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 8 Jul 2024 11:23:41 +0200 Subject: Core/Creatures: Fixed memory leaks in creature formations --- src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server/scripts/EasternKingdoms') diff --git a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp index 975e87c5da8..9b38dbfa104 100644 --- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp @@ -121,8 +121,8 @@ struct npc_cameron : public ScriptedAI // first we break formation because children will need to move on their own now for (ObjectGuid guid : _childrenGUIDs) if (Creature* child = ObjectAccessor::GetCreature(*me, guid)) - if (child->GetFormation()) - child->GetFormation()->RemoveMember(child); + if (CreatureGroup* creatureGroup = child->GetFormation()) + sFormationMgr->RemoveCreatureFromGroup(creatureGroup, child); // Move each child to an random position for (uint32 i = 0; i < _childrenGUIDs.size(); ++i) -- cgit v1.2.3