aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-31 18:21:45 -0600
committermegamage <none@none>2009-03-31 18:21:45 -0600
commit8408fb7cd31156aabffd9576d8854ccaf0931098 (patch)
tree55d86974f791f9d7fb22366c4ac56609f042d80a /src/game
parent84f3bf8b7132ce7960fac868bbcdf573bad8da3d (diff)
parent7f209249a26d76ee01db9c128226a24d87629553 (diff)
*Merge.
--HG-- branch : trunk
Diffstat (limited to 'src/game')
-rw-r--r--src/game/Creature.cpp1
-rw-r--r--src/game/CreatureAI.h6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index fa82c3b1eac..049218cca86 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -612,6 +612,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
i_AI = ai ? ai : FactorySelector::selectAI(this);
if(oldAI) delete oldAI;
IsAIEnabled = true;
+ i_AI->Reset();
return true;
}
diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h
index a15ae59a0ad..7388aab786c 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();
};