summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-01-23 15:53:24 +0000
committersmatz <smatz@openttd.org>2009-01-23 15:53:24 +0000
commit0e8a5bc9085fc8c9b44aea7f6afe29af7bcabb6a (patch)
tree332bdb77cc3011a557631be0792623c321a02b8b
parentcdac8965bd337cebba306bd5b01639fa402cfa7a (diff)
downloadopenttd-0e8a5bc9085fc8c9b44aea7f6afe29af7bcabb6a.tar.xz
(svn r15230) -Fix (r1): aircraft could have zero speed while in air after loading old savegame
-rw-r--r--src/saveload/vehicle_sl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index 1afd2b4f4..b51c17655 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -170,8 +170,8 @@ void UpdateOldAircraft()
Vehicle *v_oldstyle;
FOR_ALL_VEHICLES(v_oldstyle) {
- /* airplane has another vehicle with subtype 4 (shadow), helicopter also has 3 (rotor)
- * skip those */
+ /* airplane has another vehicle with subtype 4 (shadow), helicopter also has 3 (rotor)
+ * skip those */
if (v_oldstyle->type == VEH_AIRCRAFT && IsNormalAircraft(v_oldstyle)) {
/* airplane in terminal stopped doesn't hurt anyone, so goto next */
if (v_oldstyle->vehstatus & VS_STOPPED && v_oldstyle->u.air.state == 0) {
@@ -181,6 +181,7 @@ void UpdateOldAircraft()
AircraftLeaveHangar(v_oldstyle); // make airplane visible if it was in a depot for example
v_oldstyle->vehstatus &= ~VS_STOPPED; // make airplane moving
+ v_oldstyle->cur_speed = v_oldstyle->max_speed; // so aircraft don't have zero speed while in air
if (!v_oldstyle->current_order.IsType(OT_GOTO_STATION) && !v_oldstyle->current_order.IsType(OT_GOTO_DEPOT)) {
/* reset current order so aircraft doesn't have invalid "station-only" order */
v_oldstyle->current_order.MakeDummy();