summaryrefslogtreecommitdiff
path: root/src/vehicle_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-11-14 08:44:12 +0000
committeralberth <alberth@openttd.org>2009-11-14 08:44:12 +0000
commitfb0158c8cece2f161d2de6f75a295ad0725f8470 (patch)
tree26b306f2e9b8fe472a613448541608e454bea69e /src/vehicle_gui.cpp
parente016fa0fac3438a42af6eb60a40e8dc83a2d79c6 (diff)
downloadopenttd-fb0158c8cece2f161d2de6f75a295ad0725f8470.tar.xz
(svn r18067) -Codechange: Eliminate a constant representing a widget top edge in vehicle windows.
Diffstat (limited to 'src/vehicle_gui.cpp')
-rw-r--r--src/vehicle_gui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp
index fea1ab403..2f67b5023 100644
--- a/src/vehicle_gui.cpp
+++ b/src/vehicle_gui.cpp
@@ -1030,7 +1030,7 @@ public:
return;
case VLW_WIDGET_LIST: { // Matrix to show vehicles
- uint32 id_v = (pt.y - PLY_WND_PRC__OFFSET_TOP_WIDGET) / this->resize.step_height;
+ uint32 id_v = (pt.y - this->GetWidget<NWidgetBase>(VLW_WIDGET_LIST)->pos_y) / this->resize.step_height;
const Vehicle *v;
if (id_v >= this->vscroll.GetCapacity()) return; // click out of bounds