OpenTTD Source: src/settings_cmd.h File Reference

OpenTTD Source 15.0-RC2

Functions
settings_cmd.h File Reference

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.

## Detailed Description

Command definitions related to settings.

Definition in file settings_cmd.h.

## Function Documentation

## ◆ CmdChangeCompanySetting()

CommandCost CmdChangeCompanySetting | ( | DoCommandFlags | flags,
|  | const std::string & | name,
|  | int32_t | value
| ) |  |

Change one of the per-company settings.

Parameters

  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

Returns
  the cost of this operation or an error

Definition at line 1796 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().

## ◆ CmdChangeSetting()

CommandCost CmdChangeSetting | ( | DoCommandFlags | flags,
|  | const std::string & | name,
|  | int32_t | value
| ) |  |

Network-safe changing of settings (server-only).

Parameters

  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

Returns
  the cost of this operation or an error

See also
  _settings

Definition at line 1770 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.