Core/Creatures: Moved autoattack handling from scripts to game

This commit is contained in:
Shauren
2024-01-08 22:23:12 +01:00
parent eeb4407f07
commit 605e5f94c0
425 changed files with 393 additions and 1816 deletions
@@ -149,10 +149,7 @@ void ScriptedAI::AttackStart(Unit* who)
void ScriptedAI::UpdateAI(uint32 /*diff*/)
{
// Check if we have a current target
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
UpdateVictim();
}
void ScriptedAI::DoStartMovement(Unit* victim, float distance, float angle)
@@ -629,8 +626,6 @@ void BossAI::UpdateAI(uint32 diff)
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}
bool BossAI::CanAIAttack(Unit const* target) const
@@ -716,6 +711,4 @@ void WorldBossAI::UpdateAI(uint32 diff)
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
}
DoMeleeAttackIfReady();
}