summaryrefslogtreecommitdiff
path: root/roadveh_gui.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-10 14:36:08 +0000
committerdarkvater <darkvater@openttd.org>2005-01-10 14:36:08 +0000
commit58dc91f64daab96cc03540634afb00ae9d51a76c (patch)
treea7e67a077b2e3c187c31a268e2dbd42039284628 /roadveh_gui.c
parent54e82ebbef807f4276f63824d8e8fedcc0715e6e (diff)
downloadopenttd-58dc91f64daab96cc03540634afb00ae9d51a76c.tar.xz
(svn r1464) -Fix: [1099106] Resizeable portion of bus/air/rail depots window unclickable
Diffstat (limited to 'roadveh_gui.c')
-rw-r--r--roadveh_gui.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/roadveh_gui.c b/roadveh_gui.c
index ab835ecf8..5fad9f8a0 100644
--- a/roadveh_gui.c
+++ b/roadveh_gui.c
@@ -544,7 +544,7 @@ static void DrawRoadDepotWindow(Window *w)
static int GetVehicleFromRoadDepotWndPt(Window *w, int x, int y, Vehicle **veh)
{
- uint xt,yt,xm;
+ uint xt,row,xm;
TileIndex tile;
Vehicle *v;
int pos;
@@ -554,11 +554,11 @@ static int GetVehicleFromRoadDepotWndPt(Window *w, int x, int y, Vehicle **veh)
if (xt >= 5)
return 1;
- yt = (y - 14) / 14;
- if (yt >= 3)
+ row = (y - 14) / 14;
+ if (row >= w->vscroll.cap)
return 1;
- pos = (yt + w->vscroll.pos) * 5 + xt;
+ pos = (row + w->vscroll.pos) * 5 + xt;
tile = w->window_number;
FOR_ALL_VEHICLES(v) {