mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Added more BG hooks, fixed a few issues
This commit is contained in:
@@ -96,6 +96,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)),
|
||||
@@ -104,7 +105,6 @@ GameObjectEventBindings(new EntryBind<HookMgr::GameObjectEvents>("GameObjectEven
|
||||
GameObjectGossipBindings(new EntryBind<HookMgr::GossipEvents>("GossipEvents (gameobject)", *this)),
|
||||
ItemEventBindings(new EntryBind<HookMgr::ItemEvents>("ItemEvents", *this)),
|
||||
ItemGossipBindings(new EntryBind<HookMgr::GossipEvents>("GossipEvents (item)", *this)),
|
||||
BGEventBindings(new EntryBind<HookMgr::BGEvents>("BGEvents", *this)),
|
||||
playerGossipBindings(new EntryBind<HookMgr::GossipEvents>("GossipEvents (player)", *this))
|
||||
{
|
||||
// open base lua
|
||||
@@ -659,6 +659,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)
|
||||
{
|
||||
@@ -771,14 +779,6 @@ void Eluna::Register(uint8 regtype, uint32 id, uint32 evt, int functionRef)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case HookMgr::REGTYPE_BG:
|
||||
if (evt < HookMgr::BG_EVENT_COUNT)
|
||||
{
|
||||
BGEventBindings->Insert(id, evt, functionRef);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
luaL_unref(L, LUA_REGISTRYINDEX, functionRef);
|
||||
luaL_error(L, "Unknown event type (regtype %d, id %d, event %d)", regtype, id, evt);
|
||||
|
||||
Reference in New Issue
Block a user