mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 06:06:23 +00:00
fix(Core/Movement): properly handle UNIT_STATE_CHARGING (#7152)
- Closes #6065 - Closes #6669
This commit is contained in:
@@ -29,6 +29,11 @@ void PointMovementGenerator<T>::DoInitialize(T* unit)
|
||||
unit->StopMoving();
|
||||
|
||||
unit->AddUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
|
||||
if (id == EVENT_CHARGE)
|
||||
{
|
||||
unit->AddUnitState(UNIT_STATE_CHARGING);
|
||||
}
|
||||
|
||||
i_recalculateSpeed = false;
|
||||
Movement::MoveSplineInit init(unit);
|
||||
if (m_precomputedPath.size() > 2) // pussywizard: for charge
|
||||
@@ -131,6 +136,10 @@ template<class T>
|
||||
void PointMovementGenerator<T>::DoFinalize(T* unit)
|
||||
{
|
||||
unit->ClearUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
|
||||
if (id == EVENT_CHARGE)
|
||||
{
|
||||
unit->ClearUnitState(UNIT_STATE_CHARGING);
|
||||
}
|
||||
|
||||
if (unit->movespline->Finalized())
|
||||
MovementInform(unit);
|
||||
@@ -143,6 +152,10 @@ void PointMovementGenerator<T>::DoReset(T* unit)
|
||||
unit->StopMoving();
|
||||
|
||||
unit->AddUnitState(UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE);
|
||||
if (id == EVENT_CHARGE)
|
||||
{
|
||||
unit->AddUnitState(UNIT_STATE_CHARGING);
|
||||
}
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
||||
Reference in New Issue
Block a user