Codechange: Replace FOR_ALL_CARGOPACKETS with range-based for loops

This commit is contained in:
glx
2019-12-15 17:37:35 +01:00
committed by Niels Martin Hansen
parent 60e3cf8aff
commit 5fce5fa300
3 changed files with 4 additions and 22 deletions

View File

@@ -58,8 +58,7 @@
if (IsSavegameVersionBefore(SLV_120)) {
/* CargoPacket's source should be either INVALID_STATION or a valid station */
CargoPacket *cp;
FOR_ALL_CARGOPACKETS(cp) {
for (CargoPacket *cp : CargoPacket::Iterate()) {
if (!Station::IsValidID(cp->source)) cp->source = INVALID_STATION;
}
}
@@ -112,9 +111,7 @@ const SaveLoad *GetCargoPacketDesc()
*/
static void Save_CAPA()
{
CargoPacket *cp;
FOR_ALL_CARGOPACKETS(cp) {
for (CargoPacket *cp : CargoPacket::Iterate()) {
SlSetArrayIndex(cp->index);
SlObject(cp, GetCargoPacketDesc());
}