aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 94cdf8c3118..8fb57bafe9e 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -12637,11 +12637,11 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
return;
}
- if (vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
+ if (Creature* vehicleBaseCreature = vehicle->GetBase()->ToCreature())
{
// If a player entered a vehicle that is part of a formation, remove it from said formation
- if (CreatureGroup* creatureGroup = vehicle->GetBase()->ToCreature()->GetFormation())
- creatureGroup->RemoveMember(vehicle->GetBase()->ToCreature());
+ if (CreatureGroup* creatureGroup = vehicleBaseCreature->GetFormation())
+ sFormationMgr->RemoveCreatureFromGroup(creatureGroup, vehicleBaseCreature);
}
}
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)