aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-05 22:43:02 -0500
committermegamage <none@none>2009-06-05 22:43:02 -0500
commitc8e398281ac87abd43e87772cfab5c24d654aceb (patch)
tree2b8cd74a3c964a37a160c72b37c24cba39a125b0 /src
parentd2c30bd9f08aca991699f727db947cc8de95b63e (diff)
*Allow guardian to use scripts.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/CreatureAISelector.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/CreatureAISelector.cpp b/src/game/CreatureAISelector.cpp
index f950e9f508c..bcec34781b0 100644
--- a/src/game/CreatureAISelector.cpp
+++ b/src/game/CreatureAISelector.cpp
@@ -38,8 +38,7 @@ namespace FactorySelector
const CreatureAICreator *ai_factory = NULL;
CreatureAIRegistry &ai_registry(CreatureAIRepository::Instance());
- //player-controlled guardians with pet bar
- if(creature->HasSummonMask(SUMMON_MASK_GUARDIAN) && ((Guardian*)creature)->GetOwner()->GetTypeId() == TYPEID_PLAYER)
+ if(creature->isPet())
ai_factory = ai_registry.GetRegistryItem("PetAI");
//scriptname in db
@@ -55,7 +54,9 @@ namespace FactorySelector
// select by NPC flags
if(!ai_factory)
{
- if(creature->isVehicle() || creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
+ if(creature->isGuardian() && ((Guardian*)creature)->GetOwner()->GetTypeId() == TYPEID_PLAYER)
+ ai_factory = ai_registry.GetRegistryItem("PetAI");
+ else if(creature->isVehicle() || creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK))
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
else if(creature->isGuard())
ai_factory = ai_registry.GetRegistryItem("GuardAI");