Core/Movement: fixed an issue that allowed waypoint paths to repeat themselves even when repeating is disabled

supercedes #423
This commit is contained in:
sanctum32 authored and Ovahlord committed 2023-10-10 16:35:36 +02:00
1 parent a2658b436c
commit c783cf7d0f
1 file changed
+5 -5
@@ -27,13 +27,13 @@
#include "Transport.h"
#include "WaypointManager.h"
WaypointMovementGenerator<Creature>::WaypointMovementGenerator(uint32 pathId, bool repeating) : _lastSplineId(0), _pathId(pathId), _waypointDelay(0), _pauseTime(0),
_waypointReached(true), _recalculateSpeed(false), _repeating(repeating), _loadedFromDB(true), _stalled(false), _hasBeenStalled(false), _done(false)
WaypointMovementGenerator<Creature>::WaypointMovementGenerator(uint32 pathId, bool repeating) : _lastSplineId(0), _pathId(pathId), _waypointDelay(0),
_waypointReached(false), _recalculateSpeed(false), _repeating(repeating), _loadedFromDB(true), _stalled(false), _hasBeenStalled(false), _done(false)
{
}
WaypointMovementGenerator<Creature>::WaypointMovementGenerator(WaypointPath& path, bool repeating) : _lastSplineId(0), _pathId(0), _waypointDelay(0), _pauseTime(0),
_waypointReached(true), _recalculateSpeed(false), _repeating(repeating), _loadedFromDB(false), _stalled(false), _hasBeenStalled(false), _done(false)
WaypointMovementGenerator<Creature>::WaypointMovementGenerator(WaypointPath& path, bool repeating) : _lastSplineId(0), _pathId(0), _waypointDelay(0),
_waypointReached(false), _recalculateSpeed(false), _repeating(repeating), _loadedFromDB(false), _stalled(false), _hasBeenStalled(false), _done(false)
{
_path = &path;
}
@@ -341,7 +341,7 @@ bool WaypointMovementGenerator<Creature>::GetResetPosition(Unit* /*owner*/, floa
bool WaypointMovementGenerator<Creature>::IsAllowedToMove(Creature* creature) const
{
if (_stalled)
if (_stalled || _done)
return false;
if (_pauseTime.has_value())