mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +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>
|
||||
|
||||
@@ -5043,8 +5043,6 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
|
||||
m_caster->AddUnitState(UNIT_STATE_CHARGING);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5064,8 +5062,6 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
sScriptMgr->AnticheatSetUnderACKmount(m_caster->ToPlayer());
|
||||
}
|
||||
|
||||
m_caster->AddUnitState(UNIT_STATE_CHARGING);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5074,8 +5070,6 @@ void Spell::EffectCharge(SpellEffIndex /*effIndex*/)
|
||||
if (!unitTarget)
|
||||
return;
|
||||
|
||||
m_caster->ClearUnitState(UNIT_STATE_CHARGING);
|
||||
|
||||
if (m_caster->ToPlayer())
|
||||
{
|
||||
sScriptMgr->AnticheatSetSkipOnePacketForASH(m_caster->ToPlayer(), true);
|
||||
|
||||
Reference in New Issue
Block a user