summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2021-05-31 10:56:06 +0200
committerGitHub <noreply@github.com>2021-05-31 10:56:06 +0200
commit921ab68a480afc969d2d8c8150c23250f245ba52 (patch)
treec3558f3d49bd5a565c6a21259a8723c8c61acf8f /src/script
parent043a5442482c852dc9d2bcdf311d588d137206cd (diff)
downloadopenttd-921ab68a480afc969d2d8c8150c23250f245ba52.tar.xz
Codechange: use AsIntSetting()->Read() wrapper if possible (#9324)
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_gamesettings.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/script/api/script_gamesettings.cpp b/src/script/api/script_gamesettings.cpp
index 0ade2d7cc..b1699d94f 100644
--- a/src/script/api/script_gamesettings.cpp
+++ b/src/script/api/script_gamesettings.cpp
@@ -26,9 +26,7 @@
if (!IsValid(setting)) return -1;
const SettingDesc *sd = GetSettingFromName(setting);
-
- void *ptr = GetVariableAddress(&_settings_game, &sd->save);
- return (int32)ReadValue(ptr, sd->save.conv);
+ return sd->AsIntSetting()->Read(&_settings_game);
}
/* static */ bool ScriptGameSettings::SetValue(const char *setting, int value)