summaryrefslogtreecommitdiff
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
commitfae367ab31433c0987a2e042fb7cea40952d5ff0 (patch)
treea7e67a077b2e3c187c31a268e2dbd42039284628
parent1261a44cec0dd552b62a60f94246ec51aaea76a0 (diff)
downloadopenttd-fae367ab31433c0987a2e042fb7cea40952d5ff0.tar.xz
(svn r1464) -Fix: [1099106] Resizeable portion of bus/air/rail depots window unclickable
-rw-r--r--aircraft_gui.c8
-rw-r--r--roadveh_gui.c8
-rw-r--r--ship_gui.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/aircraft_gui.c b/aircraft_gui.c
index 163718e1d..c2242a570 100644
--- a/aircraft_gui.c
+++ b/aircraft_gui.c
@@ -735,7 +735,7 @@ static void DrawAircraftDepotWindow(Window *w)
}
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 @@ static int GetVehicleFromAircraftDepotWndPt(Window *w, int x, int y, Vehicle **v
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 --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) {
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) {