aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2024-07-08 11:23:41 +0200
committerOvahlord <dreadkiller@gmx.de>2024-07-08 13:13:06 +0200
commit7198c5223ef9a2deb8265e1ca9a3f60926310e78 (patch)
tree59b6e3803e5aad375d7a155962895fa3db9ee0c6 /src/server/scripts/EasternKingdoms
parent2fc0272533314ff7944aca7e6cf3ff7857e563c5 (diff)
Core/Creatures: Fixed memory leaks in creature formations
(cherry picked from commit 2e3920081f4f349a226ab5238cd983403e167656)
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp4
1 files changed, 2 insertions, 2 deletions
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)