Core/AI: use NullGameObjectAI for gameobjects with ScriptName

- use GameObjectAI with Transports too

--HG--
branch : trunk
This commit is contained in:
Rat
2010-10-25 18:11:52 +02:00
parent b282438198
commit 064b3fd2b3
4 changed files with 14 additions and 4 deletions
@@ -239,9 +239,12 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa
void GameObject::Update(uint32 diff)
{
if(!m_AI)
if(!AI())
{
if (!AIM_Initialize())
sLog.outError("Could not initialize GameObjectAI");
} else
AI()->UpdateAI(diff);
if (IS_MO_TRANSPORT(GetGUID()))
{
@@ -550,7 +553,6 @@ void GameObject::Update(uint32 diff)
break;
}
}
AI()->UpdateAI(diff);
sScriptMgr.OnGameObjectUpdate(this, diff);
}