Skip to content

Commit 5c59086

Browse files
author
Github Actions
committed
Merge 3.3.5 to 3.3.5-base_patch
2 parents fe7d012 + 6679ecf commit 5c59086

3 files changed

Lines changed: 12 additions & 9 deletions

File tree

src/server/game/Entities/Creature/CreatureGroups.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,21 @@ void CreatureGroup::MemberEngagingTarget(Creature* member, Unit* target)
259259
_engaging = false;
260260
}
261261

262-
void CreatureGroup::FormationReset(bool /*dismiss*/)
262+
void CreatureGroup::FormationReset(bool dismiss)
263263
{
264264
for (auto const& pair : _members)
265265
{
266266
if (pair.first != _leader && pair.first->IsAlive())
267267
{
268-
pair.first->GetMotionMaster()->MoveIdle();
269-
// TC_LOG_DEBUG("entities.unit", "CreatureGroup::FormationReset: Set {} movement for member {}", dismiss ? "default" : "idle", pair.first->GetGUID().ToString());
268+
if (dismiss)
269+
pair.first->GetMotionMaster()->Remove(FORMATION_MOTION_TYPE, MOTION_SLOT_DEFAULT);
270+
else
271+
pair.first->GetMotionMaster()->MoveIdle();
272+
TC_LOG_DEBUG("entities.unit", "CreatureGroup::FormationReset: Set {} movement for member {}", dismiss ? "default" : "idle", pair.first->GetGUID().ToString());
270273
}
271274
}
272275

273-
// _formed = !dismiss;
276+
_formed = !dismiss;
274277
}
275278

276279
void CreatureGroup::LeaderStartedMoving()

src/server/game/Entities/Unit/Unit.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12637,11 +12637,11 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
1263712637
return;
1263812638
}
1263912639

12640-
if (vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
12640+
if (Creature* vehicleBaseCreature = vehicle->GetBase()->ToCreature())
1264112641
{
1264212642
// If a player entered a vehicle that is part of a formation, remove it from said formation
12643-
if (CreatureGroup* creatureGroup = vehicle->GetBase()->ToCreature()->GetFormation())
12644-
creatureGroup->RemoveMember(vehicle->GetBase()->ToCreature());
12643+
if (CreatureGroup* creatureGroup = vehicleBaseCreature->GetFormation())
12644+
sFormationMgr->RemoveCreatureFromGroup(creatureGroup, vehicleBaseCreature);
1264512645
}
1264612646
}
1264712647

src/server/scripts/EasternKingdoms/zone_elwynn_forest.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ struct npc_cameron : public ScriptedAI
114114
// first we break formation because children will need to move on their own now
115115
for (auto guid : _childrenGUIDs)
116116
if (Creature* child = ObjectAccessor::GetCreature(*me, guid))
117-
if (child->GetFormation())
118-
child->GetFormation()->RemoveMember(child);
117+
if (CreatureGroup* creatureGroup = child->GetFormation())
118+
sFormationMgr->RemoveCreatureFromGroup(creatureGroup, child);
119119

120120
// Move each child to an random position
121121
for (uint32 i = 0; i < _childrenGUIDs.size(); ++i)

0 commit comments

Comments
 (0)