From 66876e890fe70cef58f5e3e59542948f4fc2c07d Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 9 Jan 2009 23:30:02 +0000 Subject: (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 --- src/viewport.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/viewport.cpp b/src/viewport.cpp index a20d55386..20404c61d 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -1594,6 +1594,8 @@ void UpdateViewportPosition(Window *w) const Vehicle* veh = GetVehicle(w->viewport->follow_vehicle); 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); } else { /* Ensure the destination location is within the map */ -- cgit v1.2.3-54-g00ecf