[7667] Add to CreatureAI field pointing to creature itself. Use it instead diff. fields in subclases. Author: VladimirMangos
Also send pointer to AI constructors ans mark constructors as explicit.
This changes allow move now some generic often used AI code to CreatureAI helper functions.
--HG--
branch : trunk
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
class TRINITY_DLL_DECL PassiveAI : public CreatureAI
|
||||
{
|
||||
public:
|
||||
PassiveAI(Creature *c) : CreatureAI(c) {}
|
||||
explicit PassiveAI(Creature *c) : CreatureAI(c) {}
|
||||
~PassiveAI() {}
|
||||
|
||||
void MoveInLineOfSight(Unit *) {}
|
||||
@@ -39,7 +39,7 @@ class TRINITY_DLL_DECL PassiveAI : public CreatureAI
|
||||
class TRINITY_DLL_DECL PossessedAI : public PassiveAI
|
||||
{
|
||||
public:
|
||||
PossessedAI(Creature *c) : PassiveAI(c) {}
|
||||
explicit PossessedAI(Creature *c) : PassiveAI(c) {}
|
||||
|
||||
void AttackStart(Unit *target);
|
||||
void UpdateAI(const uint32);
|
||||
@@ -52,7 +52,7 @@ class TRINITY_DLL_DECL PossessedAI : public PassiveAI
|
||||
class TRINITY_DLL_DECL NullCreatureAI : public PassiveAI
|
||||
{
|
||||
public:
|
||||
NullCreatureAI(Creature *c) : PassiveAI(c) {}
|
||||
explicit NullCreatureAI(Creature *c) : PassiveAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32) {}
|
||||
void EnterEvadeMode() {}
|
||||
@@ -61,7 +61,7 @@ class TRINITY_DLL_DECL NullCreatureAI : public PassiveAI
|
||||
class TRINITY_DLL_DECL CritterAI : public PassiveAI
|
||||
{
|
||||
public:
|
||||
CritterAI(Creature *c) : PassiveAI(c) {}
|
||||
explicit CritterAI(Creature *c) : PassiveAI(c) {}
|
||||
|
||||
void DamageTaken(Unit *done_by, uint32 & /*damage*/);
|
||||
void EnterEvadeMode();
|
||||
|
||||
Reference in New Issue
Block a user