summaryrefslogtreecommitdiff
path: root/train_gui.c
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2006-03-18 13:00:32 +0000
committerbjarni <bjarni@openttd.org>2006-03-18 13:00:32 +0000
commitaa22bfb1785333161200eb2dc9d77152a1f89816 (patch)
tree639bac77f83dcce180aec2fd5fbc0fe965ef846c /train_gui.c
parent7253ae0069cc1c7498a5f5cccb4e9c11be8ec1bd (diff)
downloadopenttd-aa22bfb1785333161200eb2dc9d77152a1f89816.tar.xz
(svn r3944) -Feature: it's now possible to turn a single unit in a train
control-click on a unit in a train in a depot will make the click unit turn around this is useful if you want "normal" engines to act as dualheaded (one each way) or similar this only works on single unit units. Multiheaded and articulated engines get a red error box this is based on a quick hack peter1138 while I made it network safe and correctly handling of multible unit engines
Diffstat (limited to 'train_gui.c')
-rw-r--r--train_gui.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/train_gui.c b/train_gui.c
index 6325db403..51565980b 100644
--- a/train_gui.c
+++ b/train_gui.c
@@ -724,7 +724,9 @@ static void TrainDepotWndProc(Window *w, WindowEvent *e)
if (GetVehicleFromTrainDepotWndPt(w, e->dragdrop.pt.x, e->dragdrop.pt.y, &gdvp) == 0 &&
sel != INVALID_VEHICLE) {
- if (gdvp.wagon == NULL || gdvp.wagon->index != sel) {
+ if (gdvp.wagon != NULL && gdvp.wagon->index == sel && _ctrl_pressed) {
+ DoCommandP(GetVehicle(sel)->tile, GetVehicle(sel)->index, true, NULL, CMD_REVERSE_TRAIN_DIRECTION | CMD_MSG(STR_9033_CAN_T_MAKE_VEHICLE_TURN));
+ } else if (gdvp.wagon == NULL || gdvp.wagon->index != sel) {
TrainDepotMoveVehicle(gdvp.wagon, sel, gdvp.head);
} else if (gdvp.head != NULL && IsFrontEngine(gdvp.head)) {
ShowTrainViewWindow(gdvp.head);