diff src/viewport.cpp @ 10645:d20b89e45634 draft

(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
author rubidium <rubidium@openttd.org>
date Fri, 09 Jan 2009 23:30:02 +0000 (2009-01-09)
parents 29bc871ff8d1
children 592ae9307430
line wrap: on
line diff
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -1594,6 +1594,8 @@
 		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 */