VarAction2: Cache refit capacity callback results which depend only on cargo

This commit is contained in:
Jonathan G Rennison
2022-06-06 18:34:30 +01:00
parent fcd9137a9f
commit 7a61b5d820
8 changed files with 109 additions and 7 deletions

View File

@@ -373,6 +373,16 @@ class NIHVehicle : public NIHelper {
output.print(buffer);
}
}
if (e->refit_capacity_values != nullptr) {
const EngineRefitCapacityValue *caps = e->refit_capacity_values.get();
CargoTypes seen = 0;
while (seen != ALL_CARGOTYPES) {
seprintf(buffer, lastof(buffer), " Refit capacity cache: cargoes: 0x" OTTD_PRINTFHEX64 " --> 0x%X", caps->cargoes, caps->capacity);
output.print(buffer);
seen |= caps->cargoes;
caps++;
}
}
YearMonthDay ymd;
ConvertDateToYMD(e->intro_date, &ymd);
seprintf(buffer, lastof(buffer), " Intro: %4i-%02i-%02i, Age: %u, Base life: %u, Durations: %u %u %u (sum: %u)",