aboutsummaryrefslogtreecommitdiff
path: root/src/game/CreatureAISelector.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-10 22:48:22 -0500
committermegamage <none@none>2009-05-10 22:48:22 -0500
commit82f886e3c1daa6ae9049bb0c0c0c00219e9735ba (patch)
tree7b8a4bbebf4365c57af8a21694a50aabecf2423a /src/game/CreatureAISelector.cpp
parent904300b4c2f0c708bc98812ec2a0be04249a81d4 (diff)
*Update AI scripts. Use better default AI.
--HG-- branch : trunk
Diffstat (limited to 'src/game/CreatureAISelector.cpp')
-rw-r--r--src/game/CreatureAISelector.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game/CreatureAISelector.cpp b/src/game/CreatureAISelector.cpp
index b270de289c7..bac4f3a4973 100644
--- a/src/game/CreatureAISelector.cpp
+++ b/src/game/CreatureAISelector.cpp
@@ -69,6 +69,18 @@ namespace FactorySelector
ai_factory = ai_registry.GetRegistryItem("CritterAI");
}
+ if(!ai_factory)
+ {
+ for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
+ {
+ if(creature->m_spells[i])
+ {
+ ai_factory = ai_registry.GetRegistryItem("SpellAI");
+ break;
+ }
+ }
+ }
+
// select by permit check
if(!ai_factory)
{