|
@@ -1717,13 +1717,13 @@ void IntSettingDesc::ChangeValue(const v
|
|
|
* @param p2 the new value for the setting
|
|
|
* The new value is properly clamped to its minimum/maximum when setting
|
|
|
* @param text unused
|
|
|
* @return the cost of this operation or an error
|
|
|
* @see _settings
|
|
|
*/
|
|
|
CommandCost CmdChangeSetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
CommandCost CmdChangeSetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text)
|
|
|
{
|
|
|
const SettingDesc *sd = GetSettingDescription(p1);
|
|
|
|
|
|
if (sd == nullptr) return CMD_ERROR;
|
|
|
if (!SlIsObjectCurrentlyValid(sd->save.version_from, sd->save.version_to)) return CMD_ERROR;
|
|
|
if (!sd->IsIntSetting()) return CMD_ERROR;
|
|
@@ -1744,13 +1744,13 @@ CommandCost CmdChangeSetting(TileIndex t
|
|
|
* @param p1 the index of the setting in the _company_settings array which identifies it
|
|
|
* @param p2 the new value for the setting
|
|
|
* The new value is properly clamped to its minimum/maximum when setting
|
|
|
* @param text unused
|
|
|
* @return the cost of this operation or an error
|
|
|
*/
|
|
|
CommandCost CmdChangeCompanySetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text)
|
|
|
CommandCost CmdChangeCompanySetting(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const std::string &text)
|
|
|
{
|
|
|
const SettingDesc *sd = GetCompanySettingDescription(p1);
|
|
|
if (sd == nullptr) return CMD_ERROR;
|
|
|
if (!sd->IsIntSetting()) return CMD_ERROR;
|
|
|
|
|
|
if (flags & DC_EXEC) {
|