OpenTTD Source 20250312-master-gcdcc6b491d
|
Command definitions related to settings. More...
#include "command_type.h"
Go to the source code of this file.
Functions | |
CommandCost | CmdChangeSetting (DoCommandFlags flags, const std::string &name, int32_t value) |
Network-safe changing of settings (server-only). | |
CommandCost | CmdChangeCompanySetting (DoCommandFlags flags, const std::string &name, int32_t value) |
Change one of the per-company settings. | |
Command definitions related to settings.
Definition in file settings_cmd.h.
CommandCost CmdChangeCompanySetting | ( | DoCommandFlags | flags, |
const std::string & | name, | ||
int32_t | value | ||
) |
Change one of the per-company settings.
flags | operation to perform |
name | the name of the company setting to change |
value | the new value for the setting The new value is properly clamped to its minimum/maximum when setting |
Definition at line 1756 of file settings.cpp.
References _current_company, SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), CMD_ERROR, Execute, Pool< Titem, Tindex, Tgrowth_step, Tpool_type, Tcache >::PoolItem<&_company_pool >::Get(), GetCompanySettingFromName(), SettingDesc::IsIntSetting(), settings, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().
CommandCost CmdChangeSetting | ( | DoCommandFlags | flags, |
const std::string & | name, | ||
int32_t | value | ||
) |
Network-safe changing of settings (server-only).
flags | operation to perform |
name | the name of the setting to change |
value | the new value for the setting The new value is properly clamped to its minimum/maximum when setting |
Definition at line 1730 of file settings.cpp.
References SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), CMD_ERROR, Execute, GetGameSettings(), GetSettingFromName(), SettingDesc::IsEditable(), SettingDesc::IsIntSetting(), SettingDesc::save, SlIsObjectCurrentlyValid(), BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test(), SaveLoad::version_from, and SaveLoad::version_to.