[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:
+3
-2
@@ -31,7 +31,7 @@ class TRINITY_DLL_DECL TotemAI : public CreatureAI
|
||||
{
|
||||
public:
|
||||
|
||||
TotemAI(Creature *c);
|
||||
explicit TotemAI(Creature *c);
|
||||
|
||||
void MoveInLineOfSight(Unit *);
|
||||
void AttackStart(Unit *);
|
||||
@@ -40,9 +40,10 @@ class TRINITY_DLL_DECL TotemAI : public CreatureAI
|
||||
|
||||
void UpdateAI(const uint32);
|
||||
static int Permissible(const Creature *);
|
||||
protected:
|
||||
Totem& getTotem();
|
||||
|
||||
private:
|
||||
Totem &i_totem;
|
||||
uint64 i_victimGuid;
|
||||
};
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user