Add: Industries can produce and accept up to 16 different cargoes

This commit is contained in:
Niels Martin Hansen
2018-07-25 19:20:17 +02:00
parent 32b9ee7063
commit 8859381d30
12 changed files with 165 additions and 116 deletions

View File

@@ -3015,6 +3015,27 @@ bool AfterLoadGame()
}
}
if (IsSavegameVersionBefore(202)) {
/* Make sure added industry cargo slots are cleared */
Industry *i;
FOR_ALL_INDUSTRIES(i) {
for (size_t ci = 2; ci < lengthof(i->produced_cargo); ci++) {
i->produced_cargo[ci] = CT_INVALID;
i->produced_cargo_waiting[ci] = 0;
i->production_rate[ci] = 0;
i->last_month_production[ci] = 0;
i->last_month_transported[ci] = 0;
i->last_month_pct_transported[ci] = 0;
i->this_month_production[ci] = 0;
i->this_month_transported[ci] = 0;
}
for (size_t ci = 3; ci < lengthof(i->accepts_cargo); ci++) {
i->accepts_cargo[ci] = CT_INVALID;
i->incoming_cargo_waiting[ci] = 0;
}
}
}
/* Station acceptance is some kind of cache */
if (IsSavegameVersionBefore(127)) {
Station *st;