Codechange: Don't assume accepted/produced slot exists.

This commit is contained in:
2023-11-29 21:30:19 +00:00
committed by Peter Nelson
parent 295508fc53
commit 00e0021e3a
5 changed files with 93 additions and 65 deletions

View File

@@ -3058,7 +3058,7 @@ bool AfterLoadGame()
* The loading routine should put the original singular value into the first array element. */
for (auto &a : i->accepted) {
if (IsValidCargoID(a.cargo)) {
a.last_accepted = i->accepted[0].last_accepted;
a.last_accepted = i->GetAccepted(0).last_accepted;
} else {
a.last_accepted = 0;
}