From fae367ab31433c0987a2e042fb7cea40952d5ff0 Mon Sep 17 00:00:00 2001 From: darkvater Date: Mon, 10 Jan 2005 14:36:08 +0000 Subject: (svn r1464) -Fix: [1099106] Resizeable portion of bus/air/rail depots window unclickable --- ship_gui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'ship_gui.c') diff --git a/ship_gui.c b/ship_gui.c index 491f42c6d..2f2fe9019 100644 --- a/ship_gui.c +++ b/ship_gui.c @@ -677,7 +677,7 @@ static void DrawShipDepotWindow(Window *w) static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh) { - uint xt,yt,xm,ym; + uint xt,row,xm,ym; TileIndex tile; Vehicle *v; int pos; @@ -687,12 +687,12 @@ static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh) if (xt >= 5) return 1; - yt = (y - 14) / 24; + row = (y - 14) / 24; ym = (y - 14) % 24; - if (yt >= 2) + if (row >= w->vscroll.cap) return 1; - pos = (yt + w->vscroll.pos) * 3 + xt; + pos = (row + w->vscroll.pos) * 3 + xt; tile = w->window_number; FOR_ALL_VEHICLES(v) { -- cgit v1.2.3-54-g00ecf