fix(Core/Movement): remove unecessary reset() (#20419)

Co-authored-by: Ovahlord <18347559+ovahlord@users.noreply.github.com>
This commit is contained in:
Grimdhex
2024-11-03 21:36:48 +01:00
committed by GitHub
parent 06514e1441
commit 08bfecdbea

View File

@@ -241,8 +241,6 @@ void RandomMovementGenerator<Creature>::DoInitialize(Creature* creature)
if (!_wanderDistance)
_wanderDistance = creature->GetWanderDistance();
_pathGenerator.reset();
_nextMoveTime.Reset(creature->GetSpawnId() && creature->GetWanderDistance() == _wanderDistance ? urand(1, 5000) : 0);
_wanderDistance = std::max((creature->GetWanderDistance() == _wanderDistance && creature->GetInstanceId() == 0) ? (creature->CanFly() ? MIN_WANDER_DISTANCE_AIR : MIN_WANDER_DISTANCE_GROUND) : 0.0f, _wanderDistance);
@@ -281,7 +279,6 @@ bool RandomMovementGenerator<Creature>::DoUpdate(Creature* creature, const uint3
{
_nextMoveTime.Reset(0); // Expire the timer
creature->StopMoving();
_pathGenerator.reset();
return true;
}