mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Vehicles: charmed units will now get their idle movement paused to avoid players riding vehicles losing control over it because the idle movement is blocking player movement
This commit is contained in:
@@ -12196,13 +12196,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (MovementGenerator* movementGenerator = GetMotionMaster()->GetMotionSlot(MOTION_SLOT_IDLE))
|
||||
movementGenerator->Pause(0);
|
||||
|
||||
GetMotionMaster()->Clear(MOTION_SLOT_ACTIVE);
|
||||
|
||||
StopMoving();
|
||||
|
||||
PauseMovement(0, MOTION_SLOT_IDLE);
|
||||
ToCreature()->AI()->OnCharmed(true);
|
||||
}
|
||||
else if (Player* player = ToPlayer())
|
||||
@@ -12319,7 +12314,6 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
else
|
||||
RestoreFaction();
|
||||
|
||||
///@todo Handle SLOT_IDLE motion resume
|
||||
GetMotionMaster()->InitDefault();
|
||||
|
||||
if (Creature* creature = ToCreature())
|
||||
|
||||
Reference in New Issue
Block a user