summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-09 23:30:02 +0000
committerrubidium <rubidium@openttd.org>2009-01-09 23:30:02 +0000
commitdc1f1664fd157e4e6d98159f2dee66d63e34e2a0 (patch)
treec6f973a8af7de1d7c8bfc36865e1abb6114099b9
parent61f19b6e3ece888a9994938cd38c11a861566920 (diff)
downloadopenttd-dc1f1664fd157e4e6d98159f2dee66d63e34e2a0.tar.xz
(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
-rw-r--r--src/viewport.cpp2
1 files changed, 2 insertions, 0 deletions
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 */