diff options
| author | Shauren <shauren.trinity@gmail.com> | 2024-07-08 11:23:41 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2024-07-08 12:45:19 +0200 |
| commit | b08d85349c54e524e7d52c2acc9e9c367b61afaf (patch) | |
| tree | 53a363fbdc72bc54b7b5f830146617b75ff74f44 /src/server/scripts | |
| parent | aca264e11b4600512a6eac53fb2295a9a7a8bb70 (diff) | |
Core/Creatures: Fixed memory leaks in creature formations
(cherry picked from commit 2e3920081f4f349a226ab5238cd983403e167656)
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp | 4 |
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 009af793d19..afb6083047e 100644 --- a/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp +++ b/src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp @@ -114,8 +114,8 @@ struct npc_cameron : public ScriptedAI // first we break formation because children will need to move on their own now for (auto 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) |
