(svn r1464) -Fix: [1099106] Resizeable portion of bus/air/rail depots window unclickable

pull/155/head
darkvater 20 years ago
parent 54e82ebbef
commit 58dc91f64d

@ -735,7 +735,7 @@ static void DrawAircraftDepotWindow(Window *w)
} }
static int GetVehicleFromAircraftDepotWndPt(Window *w, int x, int y, Vehicle **veh) { static int GetVehicleFromAircraftDepotWndPt(Window *w, int x, int y, Vehicle **veh) {
uint xt,yt,xm,ym; uint xt,row,xm,ym;
Vehicle *v; Vehicle *v;
uint tile; uint tile;
int pos; int pos;
@ -745,12 +745,12 @@ static int GetVehicleFromAircraftDepotWndPt(Window *w, int x, int y, Vehicle **v
if (xt >= 4) if (xt >= 4)
return 1; return 1;
yt = (y - 14) / 24; row = (y - 14) / 24;
ym = (y - 14) % 24; ym = (y - 14) % 24;
if (yt >= 2) if (row >= w->vscroll.cap)
return 1; return 1;
pos = (yt + w->vscroll.pos) * 4 + xt; pos = (row + w->vscroll.pos) * 4 + xt;
tile = w->window_number; tile = w->window_number;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {

@ -544,7 +544,7 @@ static void DrawRoadDepotWindow(Window *w)
static int GetVehicleFromRoadDepotWndPt(Window *w, int x, int y, Vehicle **veh) static int GetVehicleFromRoadDepotWndPt(Window *w, int x, int y, Vehicle **veh)
{ {
uint xt,yt,xm; uint xt,row,xm;
TileIndex tile; TileIndex tile;
Vehicle *v; Vehicle *v;
int pos; int pos;
@ -554,11 +554,11 @@ static int GetVehicleFromRoadDepotWndPt(Window *w, int x, int y, Vehicle **veh)
if (xt >= 5) if (xt >= 5)
return 1; return 1;
yt = (y - 14) / 14; row = (y - 14) / 14;
if (yt >= 3) if (row >= w->vscroll.cap)
return 1; return 1;
pos = (yt + w->vscroll.pos) * 5 + xt; pos = (row + w->vscroll.pos) * 5 + xt;
tile = w->window_number; tile = w->window_number;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {

@ -677,7 +677,7 @@ static void DrawShipDepotWindow(Window *w)
static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh) static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh)
{ {
uint xt,yt,xm,ym; uint xt,row,xm,ym;
TileIndex tile; TileIndex tile;
Vehicle *v; Vehicle *v;
int pos; int pos;
@ -687,12 +687,12 @@ static int GetVehicleFromShipDepotWndPt(Window *w, int x, int y, Vehicle **veh)
if (xt >= 5) if (xt >= 5)
return 1; return 1;
yt = (y - 14) / 24; row = (y - 14) / 24;
ym = (y - 14) % 24; ym = (y - 14) % 24;
if (yt >= 2) if (row >= w->vscroll.cap)
return 1; return 1;
pos = (yt + w->vscroll.pos) * 3 + xt; pos = (row + w->vscroll.pos) * 3 + xt;
tile = w->window_number; tile = w->window_number;
FOR_ALL_VEHICLES(v) { FOR_ALL_VEHICLES(v) {

Loading…
Cancel
Save