diff options
author | Patric Stout <truebrain@openttd.org> | 2021-05-29 23:27:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-29 23:27:01 +0200 |
commit | d70fb74ac669bdb64b5f594894629ec91801fd76 (patch) | |
tree | 344150f3a69cd97cf774eec16eed291ed4e2467c /src/autoreplace_gui.cpp | |
parent | 5799402f7a4872d03809838dd7fa01db42bbd282 (diff) | |
download | openttd-d70fb74ac669bdb64b5f594894629ec91801fd76.tar.xz |
Codechange: use setting name instead of index for CmdChange(Company)Setting (#9306)
This is mostly done as there are now constraints on settings.ini you might not
expected. For example, conditional settings always have to come last, as otherwise
they would influence the index.
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r-- | src/autoreplace_gui.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index a7bd071db..9f2deaf10 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -544,7 +544,7 @@ public: DoCommandP(0, this->sel_group | (GroupFlags::GF_REPLACE_WAGON_REMOVAL << 16), (HasBit(g->flags, GroupFlags::GF_REPLACE_WAGON_REMOVAL) ? 0 : 1) | (_ctrl_pressed << 1), CMD_SET_GROUP_FLAG); } else { // toggle renew_keep_length - DoCommandP(0, GetCompanySettingIndex("company.renew_keep_length"), Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, CMD_CHANGE_COMPANY_SETTING); + DoCommandP(0, 0, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, CMD_CHANGE_COMPANY_SETTING, nullptr, "company.renew_keep_length"); } break; } |