src/cargopacket.cpp
changeset 10068 a32f54c91520
parent 10067 5fdba79c2cee
equal deleted inserted replaced
10067:5fdba79c2cee 10068:a32f54c91520
   217 		} else {
   217 		} else {
   218 			/* Can move only part of the packet, so split it into two pieces */
   218 			/* Can move only part of the packet, so split it into two pieces */
   219 			if (mta != MTA_FINAL_DELIVERY) {
   219 			if (mta != MTA_FINAL_DELIVERY) {
   220 				CargoPacket *cp_new = new CargoPacket();
   220 				CargoPacket *cp_new = new CargoPacket();
   221 
   221 
   222 				Money fs = cp->feeder_share * count / cp->count;
   222 				Money fs = cp->feeder_share * count / static_cast<uint>(cp->count);
   223 				cp->feeder_share -= fs;
   223 				cp->feeder_share -= fs;
   224 
   224 
   225 				cp_new->source          = cp->source;
   225 				cp_new->source          = cp->source;
   226 				cp_new->source_xy       = cp->source_xy;
   226 				cp_new->source_xy       = cp->source_xy;
   227 				cp_new->loaded_at_xy    = (mta == MTA_CARGO_LOAD) ? data : cp->loaded_at_xy;
   227 				cp_new->loaded_at_xy    = (mta == MTA_CARGO_LOAD) ? data : cp->loaded_at_xy;