feat(Core/Instance): Add instance validation for creature scripts (#4596)
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#ifndef DEF_GNOMEREGAN_H
|
||||
#define DEF_GNOMEREGAN_H
|
||||
|
||||
#include "CreatureAIImpl.h"
|
||||
|
||||
#define GnomereganScriptName "instance_gnomeregan"
|
||||
|
||||
template <class AI, class T>
|
||||
inline AI* GetGnomereganAI(T* obj)
|
||||
{
|
||||
return GetInstanceAI<AI>(obj, GnomereganScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -2,6 +2,7 @@
|
||||
* Originally written by Xinef - Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
*/
|
||||
|
||||
#include "gnomeregan.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "Player.h"
|
||||
@@ -38,7 +39,7 @@ public:
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return new npc_kernobeeAI(creature);
|
||||
return GetGnomereganAI<npc_kernobeeAI>(creature);
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest) override
|
||||
|
||||
Reference in New Issue
Block a user