Core/Movement: Added ActionResultSetter for MovementStopReason to LaunchMoveSpline

This commit is contained in:
Golrag
2025-10-31 18:32:42 +01:00
committed by ModoX
parent 714e4539b1
commit 708e5dd55d
3 changed files with 5 additions and 4 deletions

View File

@@ -1186,7 +1186,7 @@ void MotionMaster::MoveFormation(Unit* leader, float range, float angle, uint32
}
}
void MotionMaster::LaunchMoveSpline(std::function<void(Movement::MoveSplineInit& init)>&& initializer, uint32 id/*= 0*/, MovementGeneratorPriority priority/* = MOTION_PRIORITY_NORMAL*/, MovementGeneratorType type/*= EFFECT_MOTION_TYPE*/)
void MotionMaster::LaunchMoveSpline(std::function<void(Movement::MoveSplineInit& init)>&& initializer, uint32 id/*= 0*/, MovementGeneratorPriority priority/* = MOTION_PRIORITY_NORMAL*/, MovementGeneratorType type/*= EFFECT_MOTION_TYPE*/, Scripting::v2::ActionResultSetter<MovementStopReason>&& scriptResult /*= {}*/)
{
if (IsInvalidMovementGeneratorType(type))
{
@@ -1196,7 +1196,7 @@ void MotionMaster::LaunchMoveSpline(std::function<void(Movement::MoveSplineInit&
TC_LOG_DEBUG("movement.motionmaster", "MotionMaster::LaunchMoveSpline: '{}', initiates spline Id: {} (Type: {}, Priority: {})", _owner->GetGUID(), id, type, priority);
GenericMovementGenerator* movement = new GenericMovementGenerator(std::move(initializer), type, id);
GenericMovementGenerator* movement = new GenericMovementGenerator(std::move(initializer), type, id, { .ScriptResult = scriptResult });
movement->Priority = priority;
Add(movement);
}

View File

@@ -237,7 +237,7 @@ class TC_GAME_API MotionMaster
Scripting::v2::ActionResultSetter<MovementStopReason>&& scriptResult = {});
void MoveFormation(Unit* leader, float range, float angle, uint32 point1, uint32 point2);
void LaunchMoveSpline(std::function<void(Movement::MoveSplineInit& init)>&& initializer, uint32 id = 0, MovementGeneratorPriority priority = MOTION_PRIORITY_NORMAL, MovementGeneratorType type = EFFECT_MOTION_TYPE);
void LaunchMoveSpline(std::function<void(Movement::MoveSplineInit& init)>&& initializer, uint32 id = 0, MovementGeneratorPriority priority = MOTION_PRIORITY_NORMAL, MovementGeneratorType type = EFFECT_MOTION_TYPE, Scripting::v2::ActionResultSetter<MovementStopReason>&& scriptResult = {});
private:
typedef std::unique_ptr<MovementGenerator, MovementGeneratorDeleter> MovementGeneratorPointer;

View File

@@ -19,6 +19,7 @@
#define TRINITYCORE_SCRIPT_ACTIONS_H
#include "ScriptActionResult.h"
#include "Define.h"
#include "Duration.h"
namespace Scripting::v2
@@ -28,7 +29,7 @@ class ActionBase;
template<typename T>
class ActionResultSetter;
class ActionBase
class TC_GAME_API ActionBase
{
public:
ActionBase();