(svn r24995) -Codechange: Add flags to vehicle service interval for custom & ispercent (peter1138)
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user