summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-23 09:51:33 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-27 18:49:43 +0200
commit425d50372fab501acc97981953a6c002c0a750cf (patch)
treedcfea3b6c757f1982282fff23fd14a04d9281607 /src/script
parentac99a38175c78612d058b40e7e1219d440b3d7ce (diff)
downloadopenttd-425d50372fab501acc97981953a6c002c0a750cf.tar.xz
Codechange: let SettingDesc extend SettingDescBase
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_gamesettings.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/script/api/script_gamesettings.cpp b/src/script/api/script_gamesettings.cpp
index 12435d253..f96048e15 100644
--- a/src/script/api/script_gamesettings.cpp
+++ b/src/script/api/script_gamesettings.cpp
@@ -18,7 +18,7 @@
/* static */ bool ScriptGameSettings::IsValid(const char *setting)
{
const SettingDesc *sd = GetSettingFromName(setting);
- return sd != nullptr && sd->desc.cmd != SDT_STDSTRING;
+ return sd != nullptr && sd->cmd != SDT_STDSTRING;
}
/* static */ int32 ScriptGameSettings::GetValue(const char *setting)
@@ -28,7 +28,7 @@
const SettingDesc *sd = GetSettingFromName(setting);
void *ptr = GetVariableAddress(&_settings_game, &sd->save);
- if (sd->desc.cmd == SDT_BOOLX) return *(bool*)ptr;
+ if (sd->cmd == SDT_BOOLX) return *(bool*)ptr;
return (int32)ReadValue(ptr, sd->save.conv);
}
@@ -40,7 +40,7 @@
const SettingDesc *sd = GetSettingFromName(setting);
if ((sd->save.conv & SLF_NO_NETWORK_SYNC) != 0) return false;
- if (sd->desc.cmd != SDT_BOOLX && sd->desc.cmd != SDT_NUMX) return false;
+ if (sd->cmd != SDT_BOOLX && sd->cmd != SDT_NUMX) return false;
return ScriptObject::DoCommand(0, GetSettingIndex(sd), value, CMD_CHANGE_SETTING);
}