From 518f2598f524055aa9abc1e064dfb77c22665176 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 21:06:40 +0000 Subject: [PATCH] Decompile fn_02980 (LuaScript::Register) Batch #2982 by youko: 0 byte-identical, 1 confirmed by peer review. - fn_02980 LuaScript::Register: logic confirmed by peer review Peer-reviewed-by: eAthena, meitogi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Script/LuaScript.cpp | 6 ++++++ Source/Script/LuaScript.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Source/Script/LuaScript.cpp b/Source/Script/LuaScript.cpp index c2e3bcf2..93f1f529 100644 --- a/Source/Script/LuaScript.cpp +++ b/Source/Script/LuaScript.cpp @@ -738,3 +738,9 @@ int LuaScript::TableInteger(std::string table, int keyType, std::intptr_t key) { return value; } + +// OFFSET: 0x0059CD60 +// FUNCTION: fn_02980 +void LuaScript::Register(std::string name, int (*function)(lua_State*)) { + lua_register(this->m_state, name.c_str(), function); +} diff --git a/Source/Script/LuaScript.h b/Source/Script/LuaScript.h index 4ec79f2b..63d52935 100644 --- a/Source/Script/LuaScript.h +++ b/Source/Script/LuaScript.h @@ -24,6 +24,7 @@ public: std::list TableKeys(const char* name, int unused); int TableInteger(std::string table, int keyType, std::intptr_t key); void Close(); + void Register(std::string name, int (*function)(lua_State*)); protected: /* 0000 */ lua_State* m_state;