src/vehicle.cpp
changeset 9146 dbe2317185eb
parent 9128 f4b41e7c282e
child 9184 6c18790d3929
equal deleted inserted replaced
9145:ae595994eb03 9146:dbe2317185eb
  2689  */
  2689  */
  2690 void BackuppedVehicle::BackupVehicle(Vehicle *v)
  2690 void BackuppedVehicle::BackupVehicle(Vehicle *v)
  2691 {
  2691 {
  2692 	int length = CountVehiclesInChain(v);
  2692 	int length = CountVehiclesInChain(v);
  2693 
  2693 
  2694 	uint cargo_packages_count = 1;
  2694 	size_t cargo_packages_count = 1;
  2695 	for (const Vehicle *v_count = v; v_count != NULL; v_count=v_count->Next()) {
  2695 	for (const Vehicle *v_count = v; v_count != NULL; v_count=v_count->Next()) {
  2696 		/* Now we count how many cargo packets we need to store.
  2696 		/* Now we count how many cargo packets we need to store.
  2697 		 * We started with an offset by one because we also need an end of array marker. */
  2697 		 * We started with an offset by one because we also need an end of array marker. */
  2698 		cargo_packages_count += v_count->cargo.packets.size();
  2698 		cargo_packages_count += v_count->cargo.packets.size();
  2699 	}
  2699 	}