diff options
author | rubidium <rubidium@openttd.org> | 2007-12-14 21:11:30 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-12-14 21:11:30 +0000 |
commit | 6685c7c8e2ccebc0593bcf74d7efd8c601f1e17d (patch) | |
tree | 073b8d6898781c9f79d3e3022efdc0e6424a3dac /src | |
parent | 3a0f350ab43b7a38b503fa99975a2de03df9f9da (diff) | |
download | openttd-6685c7c8e2ccebc0593bcf74d7efd8c601f1e17d.tar.xz |
(svn r11632) -Fix [FS#1541]: vehicles were still followed when sold.
Diffstat (limited to 'src')
-rw-r--r-- | src/vehicle.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 70e4fbe19..7f4e16d98 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -538,9 +538,9 @@ void Vehicle::PreDestructor() delete this->Next(); } - Window *w = FindWindowById(WC_VEHICLE_VIEW, this->index); - if (w != 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 + Window *w = FindWindowById(WC_MAIN_WINDOW, 0); + if (WP(w, vp_d).follow_vehicle == this->index) { + ScrollMainWindowTo(this->x_pos, this->y_pos, true); // lock the main view on the vehicle's last position WP(w, vp_d).follow_vehicle = INVALID_VEHICLE; } } |