diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 6 | ||||
-rw-r--r-- | src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp | 4 |
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 bd291f1ee01..d7595c411f6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12291,11 +12291,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 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) |