From c0c2f5f5bc4bf6116ecf6a864957cde6a6047f60 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 27 Oct 2026 20:58:33 +0000 Subject: [PATCH] Decompile fn_06416 (CItemDBToIDMgr::Init) Batch #1183 by eAthena: 1 byte-identical, 0 confirmed by peer review. - fn_06416 CItemDBToIDMgr::Init: byte-identical Merged automatically: every function is byte-identical to the original. Adds to the build: Source/Contents/ItemDBToIDMgr.cpp --- Source/Contents/ItemDBToIDMgr.cpp | 21 +++++++++++++++++++++ Source/Contents/ItemDBToIDMgr.h | 29 +++++++++++++++++++++++++++++ Source/Script/LuaInstance.h | 1 + data/compile.json | 1 + 4 files changed, 52 insertions(+) create mode 100644 Source/Contents/ItemDBToIDMgr.cpp create mode 100644 Source/Contents/ItemDBToIDMgr.h diff --git a/Source/Contents/ItemDBToIDMgr.cpp b/Source/Contents/ItemDBToIDMgr.cpp new file mode 100644 index 0000000..4d05b45 --- /dev/null +++ b/Source/Contents/ItemDBToIDMgr.cpp @@ -0,0 +1,21 @@ +#include "Contents/ItemDBToIDMgr.h" + +#include + +// GLOBAL: gl_24498 +CItemDBToIDMgr* g_itemDbToIdMgr = nullptr; + +// OFFSET: 0x006C7400 + +// OFFSET: 0x006C7450 +// FUNCTION: fn_06416 +void CItemDBToIDMgr::Init() { +} + +// OFFSET: 0x006C74D0 + +// OFFSET: 0x006C7540 + +// OFFSET: 0x006C7670 + +// OFFSET: 0x00E5CE60 diff --git a/Source/Contents/ItemDBToIDMgr.h b/Source/Contents/ItemDBToIDMgr.h new file mode 100644 index 0000000..c2381dc --- /dev/null +++ b/Source/Contents/ItemDBToIDMgr.h @@ -0,0 +1,29 @@ +#ifndef RAGNAROK_SOURCE_CONTENTS_ITEMDBTOIDMGR_H +#define RAGNAROK_SOURCE_CONTENTS_ITEMDBTOIDMGR_H + +#include "Script/LuaInstance.h" + +#include + +class CItemDBToIDMgr { +public: + CItemDBToIDMgr(); + virtual ~CItemDBToIDMgr(); + + static CItemDBToIDMgr* GetInstance(); + + void Init(); + bool Load(); + int GetItemID(std::string itemDBName); + +protected: + /* 0004 */ CLuaInstance m_lua; +}; + +extern CItemDBToIDMgr* g_itemDbToIdMgr; + +#if defined(_WIN32) && !defined(_WIN64) +static_assert(sizeof(CItemDBToIDMgr) == 12); +#endif + +#endif diff --git a/Source/Script/LuaInstance.h b/Source/Script/LuaInstance.h index 6e8b645..90e58a9 100644 --- a/Source/Script/LuaInstance.h +++ b/Source/Script/LuaInstance.h @@ -19,6 +19,7 @@ public: void SetGlobal(const std::string& name, int value); void SetGlobal(const std::string& name, double value); int ReadStrings(std::vector& values, const char* global); + lua_State* GetState() const { return this->m_state; } protected: /* 0004 */ lua_State* m_state; diff --git a/data/compile.json b/data/compile.json index 9109cb1..8dc1d45 100644 --- a/data/compile.json +++ b/data/compile.json @@ -331,6 +331,7 @@ "Source/Contents/Hotkeys/UserHotkeyMgr.cpp": 4, "Source/Contents/Hotkeys/UserHotkeyScript.cpp": 4, "Source/Contents/InstantVar.cpp": 0, + "Source/Contents/ItemDBToIDMgr.cpp": 4, "Source/Contents/Items/ItemDescription.cpp": 4, "Source/Contents/Items/ItemInfo.cpp": 4, "Source/Contents/Items/ItemLink.cpp": 4,