[10935] Move script calls to ScriptMgr

- Script library presence is now optional.
- Some script hooks have new names. Scripting libraries need to be adjusted accordingly.

Signed-off-by: zergtmn <zerg@myisp.com>
This commit is contained in:
zergtmn 2010-12-29 21:48:06 +05:00
parent 918e646ca2
commit ec6089bbd8
32 changed files with 454 additions and 435 deletions

View file

@ -22,7 +22,7 @@
#include "NullCreatureAI.h"
#include "Policies/SingletonImp.h"
#include "MovementGenerator.h"
#include "ScriptCalls.h"
#include "ScriptMgr.h"
#include "Pet.h"
INSTANTIATE_SINGLETON_1(CreatureAIRegistry);
@ -34,7 +34,7 @@ namespace FactorySelector
{
// 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 = Script->GetAI(creature))
if (CreatureAI* scriptedAI = sScriptMgr.GetCreatureAI(creature))
return scriptedAI;
CreatureAIRegistry &ai_registry(CreatureAIRepository::Instance());