MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetValue

Method GetValue

src/script/api/script_gamesettings.cpp:25–32  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

23}
24
25/* static */ SQInteger ScriptGameSettings::GetValue(const std::string &setting)
26{
27 if (!IsValid(setting)) return -1;
28
29 const SettingDesc *sd = GetSettingFromName(setting);
30 assert(sd != nullptr);
31 return sd->AsIntSetting()->Read(&_settings_game);
32}
33
34/* static */ bool ScriptGameSettings::SetValue(const std::string &setting, SQInteger value)
35{

Callers

nothing calls this directly

Calls 3

GetSettingFromNameFunction · 0.85
AsIntSettingMethod · 0.80
ReadMethod · 0.45

Tested by

no test coverage detected