Core/Movement: Allow overriding speed for taxi movement generator

Port From (https://github.com/TrinityCore/TrinityCore/commit/038f995ad6ce6a26f71367cae3eb7ae107527a18)
This commit is contained in:
Hondacrx
2024-08-04 17:18:56 -04:00
parent 44f1a733e7
commit 22fbfd8360
4 changed files with 33 additions and 36 deletions
@@ -14,8 +14,19 @@ namespace Game.Movement
{
public class FlightPathMovementGenerator : MovementGeneratorMedium<Player>
{
public FlightPathMovementGenerator()
float? _speed;
float _endGridX; //! X coord of last node location
float _endGridY; //! Y coord of last node location
uint _endMapId; //! map Id of last node location
uint _preloadTargetNode; //! node index where preloading starts
List<TaxiPathNodeRecord> _path = new();
int _currentNode;
List<TaxiNodeChangeInfo> _pointsForPathSwitch = new(); //! node indexes and costs where TaxiPath changes
public FlightPathMovementGenerator(float? speed)
{
_speed = speed;
Mode = MovementGeneratorMode.Default;
Priority = MovementGeneratorPriority.Highest;
Flags = MovementGeneratorFlags.InitializationPending;
@@ -61,7 +72,7 @@ namespace Game.Movement
init.SetSmooth();
init.SetUncompressed();
init.SetWalk(true);
init.SetVelocity(30.0f);
init.SetVelocity(_speed.GetValueOrDefault(30.0f));
init.Launch();
}
@@ -312,15 +323,6 @@ namespace Game.Movement
public uint GetCurrentNode() { return (uint)_currentNode; }
float _endGridX; //! X coord of last node location
float _endGridY; //! Y coord of last node location
uint _endMapId; //! map Id of last node location
uint _preloadTargetNode; //! node index where preloading starts
List<TaxiPathNodeRecord> _path = new();
int _currentNode;
List<TaxiNodeChangeInfo> _pointsForPathSwitch = new(); //! node indexes and costs where TaxiPath changes
class TaxiNodeChangeInfo
{
public TaxiNodeChangeInfo(uint pathIndex, long cost)