mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-16 16:56:07 +00:00
fix(Core/Spells): Always melee attack target when charge is over. (#7316)
* fix(Core/Spells): Always melee attack target when charge is over. Fixed #7266 * Update src/server/game/Movement/MovementGenerators/PointMovementGenerator.cpp
This commit is contained in:
@@ -139,6 +139,11 @@ void PointMovementGenerator<T>::DoFinalize(T* unit)
|
||||
if (id == EVENT_CHARGE)
|
||||
{
|
||||
unit->ClearUnitState(UNIT_STATE_CHARGING);
|
||||
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*unit, _chargeTargetGUID))
|
||||
{
|
||||
unit->Attack(target, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (unit->movespline->Finalized())
|
||||
|
||||
@@ -14,8 +14,10 @@ template<class T>
|
||||
class PointMovementGenerator : public MovementGeneratorMedium< T, PointMovementGenerator<T> >
|
||||
{
|
||||
public:
|
||||
PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f, float orientation = 0.0f, const Movement::PointsArray* _path = nullptr, bool generatePath = false, bool forceDestination = false) : id(_id),
|
||||
i_x(_x), i_y(_y), i_z(_z), speed(_speed), i_orientation(orientation), _generatePath(generatePath), _forceDestination(forceDestination)
|
||||
PointMovementGenerator(uint32 _id, float _x, float _y, float _z, float _speed = 0.0f, float orientation = 0.0f, const Movement::PointsArray* _path = nullptr,
|
||||
bool generatePath = false, bool forceDestination = false, ObjectGuid chargeTargetGUID = ObjectGuid::Empty)
|
||||
: id(_id), i_x(_x), i_y(_y), i_z(_z), speed(_speed), i_orientation(orientation), _generatePath(generatePath), _forceDestination(forceDestination),
|
||||
_chargeTargetGUID(chargeTargetGUID)
|
||||
{
|
||||
if (_path)
|
||||
m_precomputedPath = *_path;
|
||||
@@ -42,6 +44,7 @@ private:
|
||||
Movement::PointsArray m_precomputedPath;
|
||||
bool _generatePath;
|
||||
bool _forceDestination;
|
||||
ObjectGuid _chargeTargetGUID;
|
||||
};
|
||||
|
||||
class AssistanceMovementGenerator : public PointMovementGenerator<Creature>
|
||||
|
||||
Reference in New Issue
Block a user