Decompile fn_18338 (LuaScript::Load)

Batch #14694 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_18338 LuaScript::Load: logic confirmed by peer review

Peer-reviewed-by: secret, Tanke, Toshiro
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-07 14:25:59 +00:00
commit aee1eb4cf2

View file

@ -945,7 +945,7 @@ bool LuaScript::Load(const char* name, bool resourcePath, bool looseOnly) {
}
const std::uint32_t size = file.GetSize();
char* buffer = static_cast<char*>(std::malloc(size + 1));
char* buffer = new char[size + 1];
file.Read(buffer, size);
buffer[size] = '\0';
file.Close();
@ -954,11 +954,11 @@ bool LuaScript::Load(const char* name, bool resourcePath, bool looseOnly) {
std::string error = lua_tostring(this->m_state, -1);
this->Error(name, "%s\n", error.c_str());
lua_settop(this->m_state, -2);
std::free(buffer);
delete[] buffer;
return false;
}
std::free(buffer);
delete[] buffer;
return true;
}