Skip to content

Commit eca1ccf

Browse files
committed
Clean up hook registry
In preparation of replacing event IDs in documentation with globals
1 parent 4790ef8 commit eca1ccf

File tree

2 files changed

+384
-469
lines changed

2 files changed

+384
-469
lines changed

LuaEngine.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "ElunaUtility.h"
1717
#include "ElunaCreatureAI.h"
1818
#include "ElunaInstanceAI.h"
19-
#include "Hooks.h"
2019

2120
extern "C"
2221
{
@@ -193,13 +192,14 @@ void Eluna::DestroyBindStores()
193192
void Eluna::RegisterHookGlobals(lua_State* _L)
194193
{
195194
lua_newtable(_L);
196-
auto [hookData, hookCount] = HookToReadableString::getHooks();
195+
auto const& [hookData, hookCount] = Hooks::getHooks();
197196
for (size_t i = 0; i < hookCount; ++i) {
198197
const HookStorage& hs = hookData[i];
199198

200199
lua_newtable(_L); // subtable for category
201200

202-
for (size_t j = 0; j < hs.eventCount; ++j) {
201+
for (size_t j = 0; j < hs.eventCount; ++j)
202+
{
203203
lua_pushinteger(_L, hs.events[j].id);
204204
lua_setfield(_L, -2, hs.events[j].name);
205205
}

0 commit comments

Comments
 (0)