Codechange: Split CT_INVALID into CT_INVALID and INVALID_CARGO.

INVALID_CARGO is a CargoID and should be used for most purposes in game.
CT_INVALID is a CargoType used for defining default properties.
This commit is contained in:
Peter Nelson
2024-01-06 15:15:37 +00:00
committed by Peter Nelson
parent 4fd986bd07
commit 952d111b94
36 changed files with 131 additions and 129 deletions

View File

@@ -3029,13 +3029,13 @@ bool AfterLoadGame()
/* Make sure added industry cargo slots are cleared */
for (Industry *i : Industry::Iterate()) {
for (auto it = std::begin(i->produced) + 2; it != std::end(i->produced); ++it) {
it->cargo = CT_INVALID;
it->cargo = INVALID_CARGO;
it->waiting = 0;
it->rate = 0;
it->history = {};
}
for (auto it = std::begin(i->accepted) + 3; it != std::end(i->accepted); ++it) {
it->cargo = CT_INVALID;
it->cargo = INVALID_CARGO;
it->waiting = 0;
}
/* Make sure last_cargo_accepted_at is copied to elements for every valid input cargo.