summaryrefslogtreecommitdiff
path: root/src/autoreplace_gui.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-05-26 13:29:01 +0000
committeryexo <yexo@openttd.org>2009-05-26 13:29:01 +0000
commit2a5a8f395c0c71146259433a1a4abe7807d2f8ac (patch)
treee21a14ab69dcbb702f56c284719ecdbf8a0cf4fd /src/autoreplace_gui.cpp
parent55225433c4517e0daa514d0e4cd20660396d5008 (diff)
downloadopenttd-2a5a8f395c0c71146259433a1a4abe7807d2f8ac.tar.xz
(svn r16433) -Codechange: Remove most of CmdSetAutoreplace and replace it with calls to CmdChangeCompanySetting
Diffstat (limited to 'src/autoreplace_gui.cpp')
-rw-r--r--src/autoreplace_gui.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 2e8438ecf..deadcdd0a 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -17,6 +17,7 @@
#include "engine_base.h"
#include "window_gui.h"
#include "engine_gui.h"
+#include "settings_func.h"
#include "table/strings.h"
@@ -347,19 +348,19 @@ public:
}
case RVW_WIDGET_TRAIN_WAGONREMOVE_TOGGLE: // toggle renew_keep_length
- DoCommandP(0, 5, Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, CMD_SET_AUTOREPLACE);
+ DoCommandP(0, GetCompanySettingIndex("company.renew_keep_length"), Company::Get(_local_company)->settings.renew_keep_length ? 0 : 1, CMD_CHANGE_COMPANY_SETTING);
break;
case RVW_WIDGET_START_REPLACE: { // Start replacing
EngineID veh_from = this->sel_engine[0];
EngineID veh_to = this->sel_engine[1];
- DoCommandP(0, 3 + (this->sel_group << 16) , veh_from + (veh_to << 16), CMD_SET_AUTOREPLACE);
+ DoCommandP(0, this->sel_group << 16, veh_from + (veh_to << 16), CMD_SET_AUTOREPLACE);
this->SetDirty();
} break;
case RVW_WIDGET_STOP_REPLACE: { // Stop replacing
EngineID veh_from = this->sel_engine[0];
- DoCommandP(0, 3 + (this->sel_group << 16), veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE);
+ DoCommandP(0, this->sel_group << 16, veh_from + (INVALID_ENGINE << 16), CMD_SET_AUTOREPLACE);
this->SetDirty();
} break;