diff options
author | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-07-25 19:20:17 +0200 |
---|---|---|
committer | Niels Martin Hansen <nielsm@indvikleren.dk> | 2018-11-03 21:43:54 +0100 |
commit | 8859381d301a60169e167431c97cb084b7730ead (patch) | |
tree | 3daf7557f10f114e31cf88a5d463acf28a68be62 /src/saveload/afterload.cpp | |
parent | 32b9ee7063b79ae6621762db2a006d6ed267502f (diff) | |
download | openttd-8859381d301a60169e167431c97cb084b7730ead.tar.xz |
Add: Industries can produce and accept up to 16 different cargoes
Diffstat (limited to 'src/saveload/afterload.cpp')
-rw-r--r-- | src/saveload/afterload.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index cca9ad328..1529aca2b 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -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; |