src/cargopacket.cpp
changeset 7870 57194f624020
parent 7626 baab18f2a00c
child 7876 e840397bc94f
equal deleted inserted replaced
7869:ce89365071ee 7870:57194f624020
    19 	/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
    19 	/* We don't use FOR_ALL here, because FOR_ALL skips invalid items.
    20 	 *  TODO - This is just a temporary stage, this will be removed. */
    20 	 *  TODO - This is just a temporary stage, this will be removed. */
    21 	for (CargoPacket *cp = GetCargoPacket(cpart_item); cp != NULL; cp = (cp->index + 1U < GetCargoPacketPoolSize()) ? GetCargoPacket(cp->index + 1U) : NULL) cp->index = cpart_item++;
    21 	for (CargoPacket *cp = GetCargoPacket(cpart_item); cp != NULL; cp = (cp->index + 1U < GetCargoPacketPoolSize()) ? GetCargoPacket(cp->index + 1U) : NULL) cp->index = cpart_item++;
    22 }
    22 }
    23 
    23 
    24 static void CargoPacketPoolCleanBlock(uint cpart_item, uint end_item)
    24 static void CargoPacketPoolCleanBlock(uint start_item, uint end_item)
    25 {
    25 {
    26 	for (uint i = cpart_item; i <= end_item; i++) {
    26 	for (uint i = start_item; i <= end_item; i++) {
    27 		CargoPacket *cp = GetCargoPacket(i);
    27 		CargoPacket *cp = GetCargoPacket(i);
    28 		if (cp->IsValid()) cp->~CargoPacket();
    28 		if (cp->IsValid()) cp->~CargoPacket();
    29 	}
    29 	}
    30 }
    30 }
    31 
    31