diff options
| author | megamage <none@none> | 2009-03-31 18:12:49 -0600 |
|---|---|---|
| committer | megamage <none@none> | 2009-03-31 18:12:49 -0600 |
| commit | 7f209249a26d76ee01db9c128226a24d87629553 (patch) | |
| tree | 203a171e6c99d675b25da7612bd53060caf245b8 /src/game | |
| parent | bd1a630463b4652e989f462cb7f2bc349e35ecea (diff) | |
*Do not call reset in construct funciton of script.
*Add function doaction to safely pass parameters between scripts.
--HG--
branch : trunk
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/Creature.cpp | 1 | ||||
| -rw-r--r-- | src/game/CreatureAI.h | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index ad3f435ae53..19d23162873 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -616,6 +616,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai) i_motionMaster.Initialize(); i_AI = ai ? ai : FactorySelector::selectAI(this); IsAIEnabled = true; + i_AI->Reset(); return true; } diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index 1cfeb6555f2..275ecbeb3b4 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -79,9 +79,15 @@ class TRINITY_DLL_SPEC UnitAI virtual void AttackStart(Unit *); virtual void UpdateAI(const uint32 diff) = 0; + // Initialize + virtual void Reset() {}; + // Called when unit is charmed virtual void OnCharmed(bool apply) = 0; + // Pass parameters between AI + virtual void DoAction(const int32 param) {} + //Do melee swing of current victim if in rnage and ready and not casting void DoMeleeAttackIfReady(); }; |
