summaryrefslogtreecommitdiff
path: root/src/depot_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-07-20 19:21:18 +0000
committerrubidium <rubidium@openttd.org>2008-07-20 19:21:18 +0000
commit8113efb0f2d3cd9af59e6a782e671fc1976e4ac3 (patch)
tree6fcf8a160a5a544d096084931b801439776c3b40 /src/depot_gui.cpp
parent7154069dd0edea462da229159045e8ae80cf67ae (diff)
downloadopenttd-8113efb0f2d3cd9af59e6a782e671fc1976e4ac3.tar.xz
(svn r13759) -Fix [FS#2147]: selecting non-full length vehicles in the depot gui would place the "mouse pointer" out of the center of the vehicle making it hard to "aim".
Diffstat (limited to 'src/depot_gui.cpp')
-rw-r--r--src/depot_gui.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp
index cbec1179c..bace1d19f 100644
--- a/src/depot_gui.cpp
+++ b/src/depot_gui.cpp
@@ -513,6 +513,20 @@ struct DepotWindow : Window {
this->sel = v->index;
this->SetDirty();
SetObjectToPlaceWnd(image, GetVehiclePalette(v), VHM_DRAG, this);
+
+ switch (v->type) {
+ case VEH_TRAIN:
+ _cursor.short_vehicle_offset = 16 - v->u.rail.cached_veh_length * 2;
+ break;
+
+ case VEH_ROAD:
+ _cursor.short_vehicle_offset = 16 - v->u.road.cached_veh_length * 2;
+ break;
+
+ default:
+ _cursor.short_vehicle_offset = 0;
+ break;
+ }
_cursor.vehchain = _ctrl_pressed;
}
} break;