summaryrefslogtreecommitdiff
path: root/ship_gui.c
diff options
context:
space:
mode:
authordarkvater <darkvater@openttd.org>2005-01-10 14:56:26 +0000
committerdarkvater <darkvater@openttd.org>2005-01-10 14:56:26 +0000
commitbfa6755023a719df83c82002195c23410493a8f3 (patch)
tree7ca6c10af36fca82cd1d16d5f1be216f881c591e /ship_gui.c
parent781648ada3529a98b13c948b4ed13e410be629eb (diff)
downloadopenttd-bfa6755023a719df83c82002195c23410493a8f3.tar.xz
(svn r1466) -Fix: oops, depot windows can of course also scroll horizontally. Thanks si-m1.
Diffstat (limited to 'ship_gui.c')
-rw-r--r--ship_gui.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ship_gui.c b/ship_gui.c
index 2f2fe9019..3495a1652 100644
--- a/ship_gui.c
+++ b/ship_gui.c
@@ -684,7 +684,7 @@ static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh)
xt = x / 90;
xm = x % 90;
- if (xt >= 5)
+ if (xt >= w->hscroll.cap)
return 1;
row = (y - 14) / 24;
@@ -692,7 +692,7 @@ static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh)
if (row >= w->vscroll.cap)
return 1;
- pos = (row + w->vscroll.pos) * 3 + xt;
+ pos = (row + w->vscroll.pos) * w->hscroll.cap + xt;
tile = w->window_number;
FOR_ALL_VEHICLES(v) {