mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Creatures: Moved autoattack handling from scripts to game
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -248,10 +248,7 @@ void EscortAI::UpdateAI(uint32 diff)
|
||||
|
||||
void EscortAI::UpdateEscortAI(uint32 /*diff*/)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
void EscortAI::AddWaypoint(uint32 id, float x, float y, float z, bool run)
|
||||
|
||||
@@ -147,10 +147,7 @@ void FollowerAI::UpdateAI(uint32 uiDiff)
|
||||
|
||||
void FollowerAI::UpdateFollowerAI(uint32 /*uiDiff*/)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
UpdateVictim();
|
||||
}
|
||||
|
||||
void FollowerAI::StartFollow(Player* player, uint32 factionForFollower, uint32 quest)
|
||||
|
||||
Reference in New Issue
Block a user