[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:
@@ -251,7 +251,7 @@ class TRINITY_DLL_SPEC CreatureEventAI : public CreatureAI
|
||||
{
|
||||
|
||||
public:
|
||||
CreatureEventAI(Creature *c);
|
||||
explicit CreatureEventAI(Creature *c);
|
||||
~CreatureEventAI()
|
||||
{
|
||||
CreatureEventAIList.clear();
|
||||
@@ -284,12 +284,8 @@ class TRINITY_DLL_SPEC CreatureEventAI : public CreatureAI
|
||||
void DoFindFriendlyMissingBuff(std::list<Creature*>& _list, float range, uint32 spellid);
|
||||
void DoFindFriendlyCC(std::list<Creature*>& _list, float range);
|
||||
|
||||
//Pointer to creature we are manipulating
|
||||
Creature& m_creature;
|
||||
|
||||
//Bool for if we are in combat or not
|
||||
bool InCombat;
|
||||
|
||||
//Holder for events (stores enabled, time, and eventid)
|
||||
std::list<CreatureEventAIHolder> CreatureEventAIList;
|
||||
uint32 EventUpdateTime; //Time between event updates
|
||||
|
||||
Reference in New Issue
Block a user