File diff r18781:e1de9a06f7cd → r18782:6453522c2154
src/cargopacket.cpp
Show inline comments
 
@@ -79,13 +79,13 @@ CargoPacket::CargoPacket(uint16 count, b
 

	
 
/**
 
 * Split this packet in two and return the split off part.
 
 * @param new_size Size of the remaining part.
 
 * @return Split off part, or NULL if no packet could be allocated!
 
 */
 
FORCEINLINE CargoPacket *CargoPacket::Split(uint new_size)
 
inline CargoPacket *CargoPacket::Split(uint new_size)
 
{
 
	if (!CargoPacket::CanAllocateItem()) return NULL;
 

	
 
	Money fs = this->feeder_share * new_size / static_cast<uint>(this->count);
 
	CargoPacket *cp_new = new CargoPacket(new_size, this->days_in_transit, this->source, this->source_xy, this->loaded_at_xy, fs, this->source_type, this->source_id);
 
	this->feeder_share -= fs;
 
@@ -94,13 +94,13 @@ FORCEINLINE CargoPacket *CargoPacket::Sp
 
}
 

	
 
/**
 
 * Merge another packet into this one.
 
 * @param cp Packet to be merged in.
 
 */
 
FORCEINLINE void CargoPacket::Merge(CargoPacket *cp)
 
inline void CargoPacket::Merge(CargoPacket *cp)
 
{
 
	this->count += cp->count;
 
	this->feeder_share += cp->feeder_share;
 
	delete cp;
 
}