rodecomp/Source/Contents/Configuration/ScriptOptions.cpp
ragnarok-clanker d1a7afc12d Decompile 7 functions in Source/Contents/Models/ModelPlayback.cpp, Source/Contents/Actors/ActorPickNode.cpp, ...
Batch #17028 by eAthena: 7 byte-identical, 0 confirmed by peer review.

- fn_17493 C3dActorV1::Update: byte-identical
- fn_17908 CActorPickNode::AddPickInfo: byte-identical
- fn_23798 CSession::GetOptionFloat: byte-identical
- fn_04322 CWhisperBlockMgr::CWhisperBlockMgr: byte-identical
- fn_04325 CWhisperBlockMgr::Initialize: byte-identical (already on main)
- fn_03648 CAdventurerAgencyMgr::CAdventurerAgencyMgr: byte-identical
- fn_03652 CAdventurerAgencyMgr::Initialize: byte-identical (already on main)

Merged automatically: every function is byte-identical to the original.
2026-11-11 12:54:30 +00:00

48 lines
1.3 KiB
C++

#include "Script/LuaScript.h"
#include "Utility/Text/GuidParse.h"
#include "Client/Session/Session.h"
#include <cstring>
// OFFSET: 0x00E0A890
// FUNCTION: fn_23800
int CSession::GetOptionInteger(const char* key, int fallback) {
int value = -1;
this->m_hotkeyScript->Call("l_GetOptionValue", "s>d", key, &value);
return value == -1 ? fallback : value;
}
// OFFSET: 0x00E0A950
// FUNCTION: fn_23801
std::string CSession::GetOptionString(const char* key, const char* fallback) {
const char* value = nullptr;
this->m_hotkeyScript->Call("l_GetOptionValue", "s>s", key, &value);
return !value || std::strcmp(value, "-1") == 0 ? fallback : value;
}
// OFFSET: 0x00E0A760
// FUNCTION: fn_23799
GUID CSession::GetOptionGuid(const char* key, const GUID& fallback) {
const char* value = nullptr;
this->m_hotkeyScript->Call("l_GetOptionValue", "s>s", key, &value);
if (value && std::strcmp(value, "-1") != 0) {
GUID parsed;
if (ParseGuid(value, std::strlen(value), parsed, true) == 1) {
return parsed;
}
}
return fallback;
}
// OFFSET: 0x00E0A670
// FUNCTION: fn_23798
float CSession::GetOptionFloat(const char* key, float fallback) {
double value = -1.0;
this->m_hotkeyScript->Call("l_GetOptionValue", "s>l", key, &value);
if (value == -1.0) {
return fallback;
}
return static_cast<float>(value);
}