summaryrefslogtreecommitdiff
path: root/src/saveload/vehicle_sl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/saveload/vehicle_sl.cpp')
-rw-r--r--src/saveload/vehicle_sl.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp
index c1e07bf3c..aebde2bb0 100644
--- a/src/saveload/vehicle_sl.cpp
+++ b/src/saveload/vehicle_sl.cpp
@@ -17,6 +17,8 @@
#include "../aircraft.h"
#include "../station_base.h"
#include "../effectvehicle_base.h"
+#include "../company_base.h"
+#include "../company_func.h"
#include "saveload.h"
@@ -349,6 +351,19 @@ void AfterLoadVehicles(bool part_of_load)
v->cargo_age_counter = _age_cargo_skip_counter;
}
}
+
+ if (IsSavegameVersionBefore(180)) {
+ /* Set service interval flags */
+ FOR_ALL_VEHICLES(v) {
+ if (!v->IsPrimaryVehicle()) continue;
+
+ const Company *c = Company::Get(v->owner);
+ int interval = CompanyServiceInterval(c, v->type);
+
+ v->SetServiceIntervalIsCustom(v->GetServiceInterval() != interval);
+ v->SetServiceIntervalIsPercent(c->settings.vehicle.servint_ispercent);
+ }
+ }
}
CheckValidVehicles();