fix(Core/Spells): Slam should suspend attack timers (#8981)
- Closes #8723
This commit is contained in:
@@ -447,12 +447,37 @@ void Unit::Update(uint32 p_time)
|
|||||||
// not implemented before 3.0.2
|
// not implemented before 3.0.2
|
||||||
// xinef: if attack time > 0, reduce by diff
|
// xinef: if attack time > 0, reduce by diff
|
||||||
// if on next update, attack time < 0 assume player didnt attack - set to 0
|
// if on next update, attack time < 0 assume player didnt attack - set to 0
|
||||||
if (int32 base_attack = getAttackTimer(BASE_ATTACK))
|
bool suspendAttackTimer = false;
|
||||||
setAttackTimer(BASE_ATTACK, base_attack > 0 ? base_attack - (int32)p_time : 0);
|
if (IsPlayer() && HasUnitState(UNIT_STATE_CASTING))
|
||||||
if (int32 ranged_attack = getAttackTimer(RANGED_ATTACK))
|
{
|
||||||
setAttackTimer(RANGED_ATTACK, ranged_attack > 0 ? ranged_attack - (int32)p_time : 0);
|
for (Spell* spell : m_currentSpells)
|
||||||
if (int32 off_attack = getAttackTimer(OFF_ATTACK))
|
{
|
||||||
setAttackTimer(OFF_ATTACK, off_attack > 0 ? off_attack - (int32)p_time : 0);
|
if (spell)
|
||||||
|
{
|
||||||
|
if (spell->GetSpellInfo()->HasAttribute(SPELL_ATTR2_DO_NOT_RESET_COMBAT_TIMERS))
|
||||||
|
{
|
||||||
|
suspendAttackTimer = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!suspendAttackTimer)
|
||||||
|
{
|
||||||
|
if (int32 base_attack = getAttackTimer(BASE_ATTACK))
|
||||||
|
{
|
||||||
|
setAttackTimer(BASE_ATTACK, base_attack > 0 ? base_attack - (int32) p_time : 0);
|
||||||
|
}
|
||||||
|
if (int32 ranged_attack = getAttackTimer(RANGED_ATTACK))
|
||||||
|
{
|
||||||
|
setAttackTimer(RANGED_ATTACK, ranged_attack > 0 ? ranged_attack - (int32) p_time : 0);
|
||||||
|
}
|
||||||
|
if (int32 off_attack = getAttackTimer(OFF_ATTACK))
|
||||||
|
{
|
||||||
|
setAttackTimer(OFF_ATTACK, off_attack > 0 ? off_attack - (int32) p_time : 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// update abilities available only for fraction of time
|
// update abilities available only for fraction of time
|
||||||
UpdateReactives(p_time);
|
UpdateReactives(p_time);
|
||||||
|
|||||||
Reference in New Issue
Block a user