Decompile fn_18376 (LookupMessage)

Batch #15888 by eAthena: 1 byte-identical, 0 confirmed by peer review.

- fn_18376 LookupMessage: byte-identical

Merged automatically: every function is byte-identical to the original.
This commit is contained in:
ragnarok-clanker 2026-11-10 11:20:22 +00:00
commit 1a061bbfc3

View file

@ -4920,25 +4920,23 @@ const char* LookupMessage(int id) {
}
auto found = g_messageStrings.find(id);
if (found != g_messageStrings.end()) {
const std::string& text = found->second;
if (!g_inlineCharset || text[0] == '/' || text == "NO MSG") {
return text.c_str();
if (g_messageStrings.end() != found) {
if (!g_inlineCharset || found->second[0] == '/' || found->second == "NO MSG") {
return found->second.c_str();
}
// STATIC: 0x016D57B4
// GLOBAL: gl_24383
static std::vector<std::string> cached(4698);
std::string& result = cached[id];
if (result.empty() || g_serviceType == 19) {
if (cached[id].empty() || g_serviceType == 19) {
// STATIC: 0x016D57C8
// GLOBAL: gl_24384
static char buffer[260];
_snprintf_s(buffer, sizeof(buffer), _TRUNCATE, "%s%s", g_serverLanguage->Prefix(true), text.c_str());
result = buffer;
_snprintf_s(buffer, sizeof(buffer), _TRUNCATE, "%s%s", g_serverLanguage->Prefix(true), found->second.c_str());
cached[id] = buffer;
}
return result.c_str();
return cached[id].c_str();
}
return "NO MSG";