(svn r14947) -Fix [FS#2519]: vehicle following did not update the location from where to smooth scroll, thus any new viewport center would smooth scroll from the location where you were just before you started following the vehicle

This commit is contained in:
rubidium
2009-01-09 23:30:02 +00:00
parent 48c97558f7
commit 66876e890f

View File

@@ -1594,6 +1594,8 @@ void UpdateViewportPosition(Window *w)
const Vehicle* veh = GetVehicle(w->viewport->follow_vehicle); const Vehicle* veh = GetVehicle(w->viewport->follow_vehicle);
Point pt = MapXYZToViewport(vp, veh->x_pos, veh->y_pos, veh->z_pos); Point pt = MapXYZToViewport(vp, veh->x_pos, veh->y_pos, veh->z_pos);
w->viewport->scrollpos_x = pt.x;
w->viewport->scrollpos_y = pt.y;
SetViewportPosition(w, pt.x, pt.y); SetViewportPosition(w, pt.x, pt.y);
} else { } else {
/* Ensure the destination location is within the map */ /* Ensure the destination location is within the map */