summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorrubidium42 <rubidium@openttd.org>2021-05-23 19:27:46 +0200
committerrubidium42 <rubidium42@users.noreply.github.com>2021-05-27 18:49:43 +0200
commit86c9ef81345901afb015930fa0e3a637acbbc709 (patch)
treeaa8df921ded7521b740f08ccd3d3fcb3ae9740e0 /src/script
parente666a962b1f0f8eeb3bab2232ce77556ddab974a (diff)
downloadopenttd-86c9ef81345901afb015930fa0e3a637acbbc709.tar.xz
Codechange: remove SettingDescType in lieu of the actual classes
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_gamesettings.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/script/api/script_gamesettings.cpp b/src/script/api/script_gamesettings.cpp
index f96048e15..8b0459367 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->cmd != SDT_STDSTRING;
+ return sd != nullptr && sd->IsIntSetting();
}
/* static */ int32 ScriptGameSettings::GetValue(const char *setting)
@@ -28,8 +28,6 @@
const SettingDesc *sd = GetSettingFromName(setting);
void *ptr = GetVariableAddress(&_settings_game, &sd->save);
- if (sd->cmd == SDT_BOOLX) return *(bool*)ptr;
-
return (int32)ReadValue(ptr, sd->save.conv);
}
@@ -40,7 +38,6 @@
const SettingDesc *sd = GetSettingFromName(setting);
if ((sd->save.conv & SLF_NO_NETWORK_SYNC) != 0) return false;
- if (sd->cmd != SDT_BOOLX && sd->cmd != SDT_NUMX) return false;
return ScriptObject::DoCommand(0, GetSettingIndex(sd), value, CMD_CHANGE_SETTING);
}