summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-11-12 01:12:32 +0000
committerbelugas <belugas@openttd.org>2007-11-12 01:12:32 +0000
commit2571f025948012e9b4f435c2c77d056ed79ba8f1 (patch)
tree24a1b850724dd359aff06d2a859b807375303016
parent3904640d02d22f68160c6fb80b4da3d1ee9b9f5a (diff)
downloadopenttd-2571f025948012e9b4f435c2c77d056ed79ba8f1.tar.xz
(svn r11417) -Fix[FS#1421]: Let the main viewport stay where the vehicle was last seen while been center-followed
-rw-r--r--src/vehicle.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index eb655b49b..3288c2dc8 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -541,6 +541,7 @@ void Vehicle::PreDestructor()
FOR_ALL_WINDOWS(wp) {
Window *w = *wp;
if (w->viewport != NULL && WP(w, vp_d).follow_vehicle == this->index) {
+ ScrollMainWindowTo(this->x_pos, this->y_pos); // lock the main view on the vehicle's last position
WP(w, vp_d).follow_vehicle = INVALID_VEHICLE;
}
}