From 2df1908c2933c88f1442dbde52658b3c5499a849 Mon Sep 17 00:00:00 2001 From: m7nu3l Date: Sun, 3 Feb 2013 02:25:58 -0300 Subject: Core/AI: Inherited AggressorAI, so the wheel is not reinvented. --- src/server/game/AI/CoreAI/ReactorAI.cpp | 29 +++-------------------------- src/server/game/AI/CoreAI/ReactorAI.h | 9 ++++----- 2 files changed, 7 insertions(+), 31 deletions(-) (limited to 'src') diff --git a/src/server/game/AI/CoreAI/ReactorAI.cpp b/src/server/game/AI/CoreAI/ReactorAI.cpp index 31b9a82c534..fef465d592c 100644 --- a/src/server/game/AI/CoreAI/ReactorAI.cpp +++ b/src/server/game/AI/CoreAI/ReactorAI.cpp @@ -23,35 +23,12 @@ #include "ObjectAccessor.h" #include "CreatureAIImpl.h" -#define REACTOR_VISIBLE_RANGE (26.46f) +// #define REACTOR_VISIBLE_RANGE (26.46f) - It has not any use at all -int -ReactorAI::Permissible(const Creature* creature) +int ReactorAI::Permissible(const Creature* creature) { if (creature->isCivilian() || creature->IsNeutralToAll()) return PERMIT_BASE_REACTIVE; return PERMIT_BASE_NO; -} - -void -ReactorAI::MoveInLineOfSight(Unit*) -{ -} - -void -ReactorAI::UpdateAI(const uint32 /*time_diff*/) -{ - // update i_victimGuid if me->getVictim() !=0 and changed - if (!UpdateVictim()) - return; - - if (me->isAttackReady()) - { - if (me->IsWithinMeleeRange(me->getVictim())) - { - me->AttackerStateUpdate(me->getVictim()); - me->resetAttackTimer(); - } - } -} +} \ No newline at end of file diff --git a/src/server/game/AI/CoreAI/ReactorAI.h b/src/server/game/AI/CoreAI/ReactorAI.h index 39af09c4a9d..6f4d704f755 100644 --- a/src/server/game/AI/CoreAI/ReactorAI.h +++ b/src/server/game/AI/CoreAI/ReactorAI.h @@ -19,19 +19,18 @@ #ifndef TRINITY_REACTORAI_H #define TRINITY_REACTORAI_H -#include "CreatureAI.h" +#include "CombatAI.h" class Unit; -class ReactorAI : public CreatureAI +class ReactorAI : public AggressorAI { public: - explicit ReactorAI(Creature* c) : CreatureAI(c) {} + explicit ReactorAI(Creature* c) : AggressorAI(c) {} - void MoveInLineOfSight(Unit*); + void MoveInLineOfSight(Unit*) {}; - void UpdateAI(const uint32); static int Permissible(const Creature*); }; #endif -- cgit v1.2.3