roadveh_gui.c
changeset 971 1b6f956d8ac5
parent 969 8c4bede35fcc
child 982 be834034b331
--- a/roadveh_gui.c	Mon Jan 10 14:43:00 2005 +0000
+++ b/roadveh_gui.c	Mon Jan 10 14:56:26 2005 +0000
@@ -551,14 +551,14 @@
 
 	xt = x / 56;
 	xm = x % 56;
-	if (xt >= 5)
+	if (xt >= w->hscroll.cap)
 		return 1;
 
 	row = (y - 14) / 14;
 	if (row >= w->vscroll.cap)
 		return 1;
 
-	pos = (row + w->vscroll.pos) * 5 + xt;
+	pos = (row + w->vscroll.pos) * w->hscroll.cap + xt;
 
 	tile = w->window_number;
 	FOR_ALL_VEHICLES(v) {