Skip to content

Commit 30131e8

Browse files
committed
Revert "Scripts/ICC: adjust random movement initialization on Vile Spirit's summon initialization"
This reverts commit a1940ab. Revert "Core/Movement: implement a parameter override to force 2D wandering" This reverts commit 8562ef1.
1 parent 48cd3c9 commit 30131e8

5 files changed

Lines changed: 8 additions & 12 deletions

File tree

src/server/game/Movement/MotionMaster.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,12 @@ void MotionMaster::MoveTargetedHome()
594594
}
595595
}
596596

597-
void MotionMaster::MoveRandom(float wanderDistance/* = 0.0f*/, bool force2DPositionRelocation/* = false*/)
597+
void MotionMaster::MoveRandom(float wanderDistance)
598598
{
599599
if (_owner->GetTypeId() == TYPEID_UNIT)
600600
{
601601
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::MoveRandom: '{}', started random movement (spawnDist: {})", _owner->GetGUID().ToString(), wanderDistance);
602-
Add(new RandomMovementGenerator<Creature>(wanderDistance, force2DPositionRelocation), MOTION_SLOT_DEFAULT);
602+
Add(new RandomMovementGenerator<Creature>(wanderDistance), MOTION_SLOT_DEFAULT);
603603
}
604604
}
605605

src/server/game/Movement/MotionMaster.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class TC_GAME_API MotionMaster
153153

154154
void MoveIdle();
155155
void MoveTargetedHome();
156-
void MoveRandom(float wanderDistance = 0.0f, bool force2DPositionRelocation = false);
156+
void MoveRandom(float wanderDistance = 0.0f);
157157
void MoveFollow(Unit* target, float dist, ChaseAngle angle, MovementSlot slot = MOTION_SLOT_ACTIVE);
158158
void MoveChase(Unit* target, Optional<ChaseRange> dist = {}, Optional<ChaseAngle> angle = {});
159159
void MoveChase(Unit* target, float dist, float angle) { MoveChase(target, ChaseRange(dist), ChaseAngle(angle)); }

src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
#include "Random.h"
2626

2727
template<class T>
28-
RandomMovementGenerator<T>::RandomMovementGenerator(float distance/* = 0.0f*/, bool force2DPositionRelocation/* = false*/) : _timer(0), _reference(), _wanderDistance(distance), _wanderSteps(0), _force2DPositionRelocation(force2DPositionRelocation)
28+
RandomMovementGenerator<T>::RandomMovementGenerator(float distance) : _timer(0), _reference(), _wanderDistance(distance), _wanderSteps(0)
2929
{
3030
this->Mode = MOTION_MODE_DEFAULT;
3131
this->Priority = MOTION_PRIORITY_NORMAL;
3232
this->Flags = MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING;
3333
this->BaseUnitState = UNIT_STATE_ROAMING;
3434
}
3535

36-
template RandomMovementGenerator<Creature>::RandomMovementGenerator(float/* distance*/, bool/* force2DPositionRelocation*/);
36+
template RandomMovementGenerator<Creature>::RandomMovementGenerator(float/* distance*/);
3737

3838
template<class T>
3939
MovementGeneratorType RandomMovementGenerator<T>::GetMovementGeneratorType() const
@@ -124,10 +124,7 @@ void RandomMovementGenerator<Creature>::SetRandomLocation(Creature* owner)
124124
Position position(_reference);
125125
float distance = frand(0.f, _wanderDistance);
126126
float angle = frand(0.f, float(M_PI * 2));
127-
if (_force2DPositionRelocation)
128-
owner->GetNearPoint2D(nullptr, position.m_positionX, position.m_positionY, distance, frand(0.f, 2.f * float(M_PI)));
129-
else
130-
owner->MovePositionToFirstCollision(position, distance, angle);
127+
owner->MovePositionToFirstCollision(position, distance, angle);
131128

132129
// Check if the destination is in LOS
133130
if (!owner->IsWithinLOS(position.GetPositionX(), position.GetPositionY(), position.GetPositionZ()))

src/server/game/Movement/MovementGenerators/RandomMovementGenerator.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ template<class T>
2828
class RandomMovementGenerator : public MovementGeneratorMedium<T, RandomMovementGenerator<T>>
2929
{
3030
public:
31-
explicit RandomMovementGenerator(float distance = 0.0f, bool force2DPositionRelocation = false);
31+
explicit RandomMovementGenerator(float distance = 0.0f);
3232

3333
MovementGeneratorType GetMovementGeneratorType() const override;
3434

@@ -51,7 +51,6 @@ class RandomMovementGenerator : public MovementGeneratorMedium<T, RandomMovement
5151
Position _reference;
5252
float _wanderDistance;
5353
uint8 _wanderSteps;
54-
bool _force2DPositionRelocation;
5554
};
5655

5756
#endif

src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ struct boss_the_lich_king : public BossAI
736736
summons.Summon(summon);
737737
summon->SetReactState(REACT_PASSIVE);
738738
summon->SetSpeedRate(MOVE_FLIGHT, 0.5f);
739-
summon->GetMotionMaster()->MoveRandom(5.0f, true);
739+
summon->GetMotionMaster()->MoveRandom(10.0f);
740740
if (!events.IsInPhase(PHASE_FROSTMOURNE))
741741
summon->m_Events.AddEvent(new VileSpiritActivateEvent(summon), summon->m_Events.CalculateTime(15s));
742742
return;

0 commit comments

Comments
 (0)