diff options
author | Shauren <shauren.trinity@gmail.com> | 2024-01-08 22:23:12 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2024-01-08 22:23:12 +0100 |
commit | 605e5f94c0d71cad8e83fa5a07eaec4e6bed9cc3 (patch) | |
tree | 5cad677458a22ef0dd187fa86d1cd574282384dd /src/server/game/AI/ScriptedAI | |
parent | eeb4407f077bf567361becdbe5083c2790f00313 (diff) |
Core/Creatures: Moved autoattack handling from scripts to game
Diffstat (limited to 'src/server/game/AI/ScriptedAI')
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 9 | ||||
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp | 5 | ||||
-rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp | 5 |
3 files changed, 3 insertions, 16 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 00c15509f5a..82c8dac896f 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -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(); } diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index ca6290d1379..19d11c4b957 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -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) diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index f12b7aaf9b6..c0a5aa3350a 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -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) |