# HG changeset patch # User darkvater # Date 1105367768 0 # Node ID 8c4bede35fcc4c32b9a2f842ed337493c2c6b73a # Parent 9c47631d62dc26c986a2ccc5e5efdbe8a08668b0 (svn r1464) -Fix: [1099106] Resizeable portion of bus/air/rail depots window unclickable diff -r 9c47631d62dc -r 8c4bede35fcc aircraft_gui.c --- a/aircraft_gui.c Mon Jan 10 14:24:40 2005 +0000 +++ b/aircraft_gui.c Mon Jan 10 14:36:08 2005 +0000 @@ -735,7 +735,7 @@ } static int GetVehicleFromAircraftDepotWndPt(Window *w, int x, int y, Vehicle **veh) { - uint xt,yt,xm,ym; + uint xt,row,xm,ym; Vehicle *v; uint tile; int pos; @@ -745,12 +745,12 @@ if (xt >= 4) 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) * 4 + xt; + pos = (row + w->vscroll.pos) * 4 + xt; tile = w->window_number; FOR_ALL_VEHICLES(v) { diff -r 9c47631d62dc -r 8c4bede35fcc roadveh_gui.c --- a/roadveh_gui.c Mon Jan 10 14:24:40 2005 +0000 +++ b/roadveh_gui.c Mon Jan 10 14:36:08 2005 +0000 @@ -544,7 +544,7 @@ 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 @@ 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) { diff -r 9c47631d62dc -r 8c4bede35fcc ship_gui.c --- a/ship_gui.c Mon Jan 10 14:24:40 2005 +0000 +++ b/ship_gui.c Mon Jan 10 14:36:08 2005 +0000 @@ -677,7 +677,7 @@ 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 @@ 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) {