Decompile 2 functions in Source/Script/NLuaState.cpp, Source/Script/NLuaState.h
Batch #3188 by eAthena: 0 byte-identical, 2 confirmed by peer review. - fn_20941 NLuaState::NLuaState: logic confirmed by peer review - fn_20944 NLuaThread::`scalar deleting destructor': logic confirmed by peer review Reviewed-by: ragnarok-clanker Adds to the build: Source/Script/NLuaState.cpp
This commit is contained in:
parent
c4a8e06a17
commit
9562207a4d
3 changed files with 71 additions and 0 deletions
35
Source/Script/NLuaState.cpp
Normal file
35
Source/Script/NLuaState.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include "Script/NLuaState.h"
|
||||
|
||||
extern "C" {
|
||||
#include <lauxlib.h>
|
||||
#include <lua.h>
|
||||
}
|
||||
|
||||
// OFFSET: 0x00CA4CF0
|
||||
// FUNCTION: fn_20941
|
||||
NLuaState::NLuaState() : m_state(nullptr), m_isValid(false) {
|
||||
this->m_state = luaL_newstate();
|
||||
if (this->m_state != nullptr) {
|
||||
this->m_isValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
NLuaState::~NLuaState() {
|
||||
if (this->m_state != nullptr) {
|
||||
lua_close(this->m_state);
|
||||
this->m_state = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
NLuaThread::NLuaThread(NLuaState& parent) : m_state(nullptr), m_isValid(false) {
|
||||
this->m_state = lua_newthread(parent.m_state);
|
||||
if (this->m_state != nullptr) {
|
||||
this->m_isValid = true;
|
||||
}
|
||||
}
|
||||
|
||||
// OFFSET: 0x00CA4E80
|
||||
// FUNCTION: fn_20944
|
||||
NLuaThread::~NLuaThread() {
|
||||
this->m_state = nullptr;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue