forked from ElunaLuaEngine/Eluna
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElunaGameObjectAI.h
34 lines (29 loc) · 899 Bytes
/
ElunaGameObjectAI.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright (C) 2010 - 2015 Eluna Lua Engine <http://emudevs.com/>
* This program is free software licensed under GPL version 3
* Please see the included DOCS/LICENSE.md for more information
*/
#ifndef _ELUNA_GAME_OBJECT_AI_H
#define _ELUNA_GAME_OBJECT_AI_H
#include "GameObject.h"
#include "LuaEngine.h"
#include "TableMgr.h"
#ifdef TRINITY
#include "GameObjectAI.h"
#else
// Temp workaround for MaNGOS - not supporting GameObjectAI yet
class GameObjectAI { public: GameObjectAI(GameObject* g) : go(g) {}
protected: GameObject* go;};
#endif
struct ElunaGameObjectAI : GameObjectAI
{
ElunaGameObjectAI(GameObject* gameobject) : GameObjectAI(gameobject)
{
go->GetMap()->GetEluna()->GetTableMgr()->CreateTable(go->GET_GUID());
}
~ElunaGameObjectAI()
{
go->GetMap()->GetEluna()->GetTableMgr()->DeleteTableRef(go->GET_GUID());
}
};
#endif