summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-10-21 21:03:40 +0000
committerfrosch <frosch@openttd.org>2011-10-21 21:03:40 +0000
commitcadaa0a8b681dae6397606880f271d57c2a049bd (patch)
tree40476bebd5fdc11b1141a61949ffde93148ddf67 /src
parent3eddb9c23fcc4aac9fc32bd6e923eada4bdcd9e5 (diff)
downloadopenttd-cadaa0a8b681dae6397606880f271d57c2a049bd.tar.xz
(svn r23050) -Fix: [NewGRF] When vehicles break down, update the image cache after changing the vehicle state to make fish happy.
Diffstat (limited to 'src')
-rw-r--r--src/vehicle.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vehicle.cpp b/src/vehicle.cpp
index 4565fc3a0..e5c239dc8 100644
--- a/src/vehicle.cpp
+++ b/src/vehicle.cpp
@@ -1090,10 +1090,6 @@ bool Vehicle::HandleBreakdown()
this->breakdowns_since_last_service++;
}
- this->MarkDirty();
- SetWindowDirty(WC_VEHICLE_VIEW, this->index);
- SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
-
if (this->type == VEH_AIRCRAFT) {
/* Aircraft just need this flag, the rest is handled elsewhere */
this->vehstatus |= VS_AIRCRAFT_BROKEN;
@@ -1111,6 +1107,11 @@ bool Vehicle::HandleBreakdown()
if (u != NULL) u->animation_state = this->breakdown_delay * 2;
}
}
+
+ this->MarkDirty(); // Update graphics after speed is zeroed
+ SetWindowDirty(WC_VEHICLE_VIEW, this->index);
+ SetWindowDirty(WC_VEHICLE_DETAILS, this->index);
+
/* FALL THROUGH */
case 1:
/* Aircraft breakdowns end only when arriving at the airport */