Core/Unit: f869c49 followup

Movement Pause/Clear is already handled in Unit::SetCharmedBy and Unit::RemoveCharmedBy, respectively

TODO: missing PAUSE handling in RandomMovementGenerator
This commit is contained in:
ccrs authored and Ovahlord committed 2019-10-17 03:32:45 +02:00
1 parent d19d0dc29e
commit 8cb10a38a4
1 file changed
+1 -14
+1 -14
View File
@@ -13460,16 +13460,9 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
if (vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
{
// If a player entered a vehicle that is part of a formation, remove it from said formation and replace current movement generator with MoveIdle (no movement)
// 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());
vehicle->GetBase()->GetMotionMaster()->MoveIdle();
}
// If the vehicle has the random movement generator active, replace it with MoveIdle (no movement) so it won't override player control
if (vehicle->GetBase()->GetMotionMaster()->GetCurrentMovementGeneratorType() == RANDOM_MOTION_TYPE)
vehicle->GetBase()->GetMotionMaster()->MoveIdle();
}
}
@@ -13579,14 +13572,8 @@ void Unit::_ExitVehicle(Position const* exitPosition)
GetMotionMaster()->LaunchMoveSpline(std::move(init), EVENT_VEHICLE_EXIT, MOTION_SLOT_CONTROLLED);
if (player)
{
player->ResummonPetTemporaryUnSummonedIfAny();
// When a player exits a creature vehicle, restore its default motion generator (if any)
if (vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
vehicle->GetBase()->GetMotionMaster()->InitializeDefault();
}
if (vehicle->GetBase()->HasUnitTypeMask(UNIT_MASK_MINION) && vehicle->GetBase()->GetTypeId() == TYPEID_UNIT)
if (((Minion*)vehicle->GetBase())->GetOwner() == this)
vehicle->GetBase()->ToCreature()->DespawnOrUnsummon(1);