mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[7667] Add to CreatureAI field pointing to creature itself. Use it instead diff. fields in subclases.
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.
This commit is contained in:
parent
721e005b84
commit
69fb9736cc
18 changed files with 379 additions and 382 deletions
|
|
@ -80,7 +80,7 @@ struct Script
|
|||
|
||||
struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
|
||||
{
|
||||
ScriptedAI(Creature* creature) : m_creature(creature) {}
|
||||
explicit ScriptedAI(Creature* creature) : CreatureAI(creature) {}
|
||||
~ScriptedAI() {}
|
||||
|
||||
// Called if IsVisible(Unit *who) is true at each *who move
|
||||
|
|
@ -122,8 +122,6 @@ struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI
|
|||
// Called when spell hits creature's target
|
||||
void SpellHitTarget(Unit*, const SpellEntry*) {}
|
||||
|
||||
Creature* m_creature;
|
||||
|
||||
//= Some useful helpers =========================
|
||||
|
||||
// Start attack of victim and go to him
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue