Codechange: Use SQInteger for generic numbers in script_gamesettings
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
return sd != nullptr && sd->IsIntSetting();
|
||||
}
|
||||
|
||||
/* static */ int32 ScriptGameSettings::GetValue(const char *setting)
|
||||
/* static */ SQInteger ScriptGameSettings::GetValue(const char *setting)
|
||||
{
|
||||
if (!IsValid(setting)) return -1;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
return sd->AsIntSetting()->Read(&_settings_game);
|
||||
}
|
||||
|
||||
/* static */ bool ScriptGameSettings::SetValue(const char *setting, int value)
|
||||
/* static */ bool ScriptGameSettings::SetValue(const char *setting, SQInteger value)
|
||||
{
|
||||
if (!IsValid(setting)) return false;
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
if ((sd->flags & SF_NO_NETWORK_SYNC) != 0) return false;
|
||||
|
||||
value = Clamp<SQInteger>(value, INT32_MIN, INT32_MAX);
|
||||
|
||||
return ScriptObject::Command<CMD_CHANGE_SETTING>::Do(sd->GetName(), value);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user