src/vehicle.cpp
changeset 6626 207875b9069a
parent 6621 441559124aea
child 6638 09c5d7bf69a5
equal deleted inserted replaced
6625:4e6286057c3d 6626:207875b9069a
  1423 
  1423 
  1424 	if ( (uint)(x -= vp->left) >= (uint)vp->width ||
  1424 	if ( (uint)(x -= vp->left) >= (uint)vp->width ||
  1425 			 (uint)(y -= vp->top) >= (uint)vp->height)
  1425 			 (uint)(y -= vp->top) >= (uint)vp->height)
  1426 				return NULL;
  1426 				return NULL;
  1427 
  1427 
  1428 	x = (x << vp->zoom) + vp->virtual_left;
  1428 	x = ScaleByZoom(x, vp->zoom) + vp->virtual_left;
  1429 	y = (y << vp->zoom) + vp->virtual_top;
  1429 	y = ScaleByZoom(y, vp->zoom) + vp->virtual_top;
  1430 
  1430 
  1431 	FOR_ALL_VEHICLES(v) {
  1431 	FOR_ALL_VEHICLES(v) {
  1432 		if ((v->vehstatus & (VS_HIDDEN|VS_UNCLICKABLE)) == 0 &&
  1432 		if ((v->vehstatus & (VS_HIDDEN|VS_UNCLICKABLE)) == 0 &&
  1433 				x >= v->left_coord && x <= v->right_coord &&
  1433 				x >= v->left_coord && x <= v->right_coord &&
  1434 				y >= v->top_coord && y <= v->bottom_coord) {
  1434 				y >= v->top_coord && y <= v->bottom_coord) {