OpenTTD Source
20241108-master-g80f628063a
|
Command definitions related to settings. More...
#include "command_type.h"
Go to the source code of this file.
Functions | |
CommandCost | CmdChangeSetting (DoCommandFlag flags, const std::string &name, int32_t value) |
Network-safe changing of settings (server-only). More... | |
CommandCost | CmdChangeCompanySetting (DoCommandFlag flags, const std::string &name, int32_t value) |
Change one of the per-company settings. More... | |
Command definitions related to settings.
Definition in file settings_cmd.h.
CommandCost CmdChangeCompanySetting | ( | DoCommandFlag | 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 1722 of file settings.cpp.
References _current_company, SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), CMD_ERROR, DC_EXEC, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_company_pool >::Get(), GetCompanySettingFromName(), SettingDesc::IsIntSetting(), and settings.
CommandCost CmdChangeSetting | ( | DoCommandFlag | 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 1696 of file settings.cpp.
References SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), CMD_ERROR, DC_EXEC, GetGameSettings(), GetSettingFromName(), SettingDesc::IsEditable(), SettingDesc::IsIntSetting(), SettingDesc::save, SlIsObjectCurrentlyValid(), SaveLoad::version_from, and SaveLoad::version_to.