diff options
author | smatz <smatz@openttd.org> | 2010-04-24 20:55:51 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2010-04-24 20:55:51 +0000 |
commit | e3c89df39888b24038790496a149b9048f2c6f0c (patch) | |
tree | 7eec301817fb2757a509f002f21497fe17287617 /src/viewport.cpp | |
parent | 82136fbc62301c0f350c51d438c10be04c863720 (diff) | |
download | openttd-e3c89df39888b24038790496a149b9048f2c6f0c.tar.xz |
(svn r19714) -Feature: ctrl+click on a vehicle to start/stop it
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r-- | src/viewport.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp index 52488e140..18999d341 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1811,7 +1811,14 @@ bool HandleViewportClicked(const ViewPort *vp, int x, int y) v = CheckClickOnVehicle(vp, x, y); if (v != NULL) { DEBUG(misc, 2, "Vehicle %d (index %d) at %p", v->unitnumber, v->index, v); - if (IsCompanyBuildableVehicleType(v)) ShowVehicleViewWindow(v->First()); + if (IsCompanyBuildableVehicleType(v)) { + v = v->First(); + if (_ctrl_pressed && v->owner == _local_company) { + StartStopVehicle(v, true); + } else { + ShowVehicleViewWindow(v); + } + } return true; } return CheckClickOnLandscape(vp, x, y); |