(svn r24995) -Codechange: Add flags to vehicle service interval for custom & ispercent (peter1138)

This commit is contained in:
rubidium
2013-02-14 17:06:49 +00:00
parent c77cd1f409
commit 369a6f9d1b
10 changed files with 85 additions and 10 deletions

View File

@@ -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();