From aa22bfb1785333161200eb2dc9d77152a1f89816 Mon Sep 17 00:00:00 2001 From: bjarni Date: Sat, 18 Mar 2006 13:00:32 +0000 Subject: (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 --- train_gui.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'train_gui.c') 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); -- cgit v1.2.3-54-g00ecf