summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-08-18 20:48:38 +0000
committerrubidium <rubidium@openttd.org>2010-08-18 20:48:38 +0000
commit926594b599e76886fd877e953036918687418b0c (patch)
treedb13aaa32a38c15aa14f64f4d01a0962889f9c0e /src/depot_gui.cpp
parent04d6648c5efd89a32669a17d6ad2711c719820d9 (diff)
downloadopenttd-926594b599e76886fd877e953036918687418b0c.tar.xz
(svn r20547) -Change: the way order backups are performed. Now restoring an order doesn't require up to 765 commands.
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index e9ba9143f..199971ac2 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -976,12 +976,7 @@ struct DepotWindow : Window {
this->SetDirty();
int sell_cmd = (v->type == VEH_TRAIN && (widget == DEPOT_WIDGET_SELL_CHAIN || _ctrl_pressed)) ? 1 : 0;
-
- bool is_engine = (v->type != VEH_TRAIN || Train::From(v)->IsFrontEngine());
-
- if (is_engine) OrderBackup::Backup(v);
-
- if (!DoCommandP(v->tile, v->index | sell_cmd << 16, 0, GetCmdSellVeh(v->type)) && is_engine) OrderBackup::Reset(this->window_number);
+ DoCommandP(v->tile, v->index | sell_cmd << 16 | MAKE_ORDER_BACKUP_FLAG, 0, GetCmdSellVeh(v->type));
break;
}