Build error fixes

43 errors left at this point
This commit is contained in:
Charles A Edwards 2016-01-30 19:17:47 +00:00 committed by Antz
parent 3abc31c429
commit 924d182855
18 changed files with 123 additions and 71 deletions

View file

@ -39,7 +39,7 @@ namespace FactorySelector
CreatureAI* selectAI(Creature* creature)
{
// Allow scripting AI for normal creatures and not controlled pets (guardians and mini-pets)
if ((!creature->IsPet() || !((Pet*)creature)->isControlled()) && !creature->isCharmed())
if ((!creature->IsPet() || !((Pet*)creature)->isControlled()) && !creature->IsCharmed())
if (CreatureAI* scriptedAI = sScriptMgr.GetCreatureAI(creature))
return scriptedAI;
@ -53,7 +53,7 @@ namespace FactorySelector
// excplicit check for isControlled() and owner type to allow guardian, mini-pets and pets controlled by NPCs to be scripted by EventAI
Unit* owner = NULL;
if ((creature->IsPet() && ((Pet*)creature)->isControlled() &&
((owner = creature->GetOwner()) && owner->GetTypeId() == TYPEID_PLAYER)) || creature->isCharmed())
((owner = creature->GetOwner()) && owner->GetTypeId() == TYPEID_PLAYER)) || creature->IsCharmed())
ai_factory = ai_registry.GetRegistryItem("PetAI");
else if (creature->IsTotem())
ai_factory = ai_registry.GetRegistryItem("TotemAI");