Merge branch 'master' of https://github.com/ElunaLuaEngine/Eluna into luaevents

This commit is contained in:
Rochet2
2014-09-13 16:05:30 +03:00
8 changed files with 335 additions and 0 deletions

View File

@@ -94,6 +94,7 @@ PlayerEventBindings(new EventBind<HookMgr::PlayerEvents>("PlayerEvents", *this))
GuildEventBindings(new EventBind<HookMgr::GuildEvents>("GuildEvents", *this)),
GroupEventBindings(new EventBind<HookMgr::GroupEvents>("GroupEvents", *this)),
VehicleEventBindings(new EventBind<HookMgr::VehicleEvents>("VehicleEvents", *this)),
BGEventBindings(new EventBind<HookMgr::BGEvents>("BGEvents", *this)),
PacketEventBindings(new EntryBind<HookMgr::PacketEvents>("PacketEvents", *this)),
CreatureEventBindings(new EntryBind<HookMgr::CreatureEvents>("CreatureEvents", *this)),
@@ -153,6 +154,7 @@ Eluna::~Eluna()
delete ItemEventBindings;
delete ItemGossipBindings;
delete playerGossipBindings;
delete BGEventBindings;
// Must close lua state after deleting stores and mgr
lua_close(L);
@@ -659,6 +661,14 @@ void Eluna::Register(uint8 regtype, uint32 id, uint32 evt, int functionRef)
}
break;
case HookMgr::REGTYPE_BG:
if (evt < HookMgr::BG_EVENT_COUNT)
{
BGEventBindings->Insert(evt, functionRef);
return;
}
break;
case HookMgr::REGTYPE_PACKET:
if (evt < HookMgr::PACKET_EVENT_COUNT)
{