OpenTTD Source 20260206-master-g4d4e37dbf1
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
flagsoperation to perform
namethe name of the company setting to change
valuethe 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 1793 of file settings.cpp.

References _current_company, SettingDesc::AsIntSetting(), IntSettingDesc::ChangeValue(), CMD_ERROR, Execute, 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
flagsoperation to perform
namethe name of the setting to change
valuethe 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 1767 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.