mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Movement: Allow specifying timeout for random movement
This commit is contained in:
@@ -596,12 +596,12 @@ void MotionMaster::MoveTargetedHome()
|
||||
}
|
||||
}
|
||||
|
||||
void MotionMaster::MoveRandom(float wanderDistance)
|
||||
void MotionMaster::MoveRandom(float wanderDistance, Optional<Milliseconds> duration)
|
||||
{
|
||||
if (_owner->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveRandom: '{}', started random movement (spawnDist: {})", _owner->GetGUID().ToString(), wanderDistance);
|
||||
Add(new RandomMovementGenerator<Creature>(wanderDistance), MOTION_SLOT_DEFAULT);
|
||||
Add(new RandomMovementGenerator<Creature>(wanderDistance, duration), MOTION_SLOT_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user