mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
Many cmangos commits applied
Many cmangos commits applied
This commit is contained in:
parent
cba86c231e
commit
8431568536
38 changed files with 173 additions and 83 deletions
|
|
@ -38,11 +38,18 @@ 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 (CreatureAI* scriptedAI = sScriptMgr.GetCreatureAI(creature))
|
||||
CreatureAI* scriptedAI = sScriptMgr.GetCreatureAI(creature);
|
||||
if (scriptedAI)
|
||||
{
|
||||
// charmed creature may have some script even if its not supposed to be that way (ex: Eye of Acherus)
|
||||
if (creature->IsCharmed())
|
||||
return scriptedAI;
|
||||
|
||||
// Allow scripting AI for normal creatures and not controlled pets (guardians and mini-pets)
|
||||
if (!creature->IsPet() || !static_cast<Pet*>(creature)->isControlled())
|
||||
return scriptedAI;
|
||||
}
|
||||
|
||||
CreatureAIRegistry& ai_registry(CreatureAIRepository::Instance());
|
||||
|
||||
const CreatureAICreator* ai_factory = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue