Decompile fn_06320 (GameSettings::ApplyScriptOption)
Batch #1686 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_06320 GameSettings::ApplyScriptOption: logic confirmed by peer review Reviewed-by: ragnarok-clanker
This commit is contained in:
parent
0270e6dd18
commit
e1d9e25c29
1 changed files with 37 additions and 0 deletions
|
|
@ -1,4 +1,28 @@
|
|||
#include "Contents/Configuration/ServiceOptions.h"
|
||||
#include "Contents/Configuration/ScriptOptions.h"
|
||||
|
||||
#include <cstddef>
|
||||
#include <vector>
|
||||
|
||||
struct GameSettingsOption {
|
||||
/* 0000 */ int id;
|
||||
/* 0004 */ unsigned char unknown_0004[0x54];
|
||||
/* 0058 */ unsigned char defaultValue;
|
||||
/* 0059 */ unsigned char unknown_0059[0xB];
|
||||
};
|
||||
|
||||
struct GameSettings {
|
||||
/* 0000 */ unsigned char unknown_0000[0xC];
|
||||
/* 000C */ std::vector<GameSettingsOption> options;
|
||||
|
||||
void ApplyScriptOption(int id, const char* key, ScriptOptions& script);
|
||||
};
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN64)
|
||||
static_assert(sizeof(GameSettingsOption) == 0x64);
|
||||
static_assert(offsetof(GameSettingsOption, defaultValue) == 0x58);
|
||||
static_assert(offsetof(GameSettings, options) == 0x0C);
|
||||
#endif
|
||||
|
||||
// GLOBAL: gl_24579
|
||||
ServiceOptions g_serviceOptions;
|
||||
|
|
@ -37,3 +61,16 @@ bool ServiceOptions::Set(int id, unsigned char value) {
|
|||
entry->second = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
// OFFSET: 0x006C1900
|
||||
// FUNCTION: fn_06320
|
||||
void GameSettings::ApplyScriptOption(int id, const char* key, ScriptOptions& script) {
|
||||
for (const GameSettingsOption& option : this->options) {
|
||||
if (option.id != id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
g_serviceOptions.Set(id, script.Integer(key, option.defaultValue) != 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue