Changeset - r8542:87e345c9e13a
[Not reviewed]
master
0 2 0
peter1138 - 17 years ago 2008-02-12 11:46:29
peter1138@openttd.org
(svn r12120) -Cleanup: const-ify parameters when checking for same cargopacket source.
2 files changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/cargopacket.cpp
Show inline comments
 
@@ -34,13 +34,13 @@ CargoPacket::CargoPacket(StationID sourc
 

	
 
CargoPacket::~CargoPacket()
 
{
 
	this->count = 0;
 
}
 

	
 
bool CargoPacket::SameSource(CargoPacket *cp)
 
bool CargoPacket::SameSource(const CargoPacket *cp) const
 
{
 
	return this->source_xy == cp->source_xy && this->days_in_transit == cp->days_in_transit && this->paid_for == cp->paid_for;
 
}
 

	
 
static const SaveLoad _cargopacket_desc[] = {
 
	SLE_VAR(CargoPacket, source,          SLE_UINT16),
src/cargopacket.h
Show inline comments
 
@@ -50,13 +50,13 @@ struct CargoPacket : PoolItem<CargoPacke
 
	/**
 
	 * Checks whether the cargo packet is from (exactly) the same source
 
	 * in time and location.
 
	 * @param cp the cargo packet to compare to
 
	 * @return true if and only if days_in_transit and source_xy are equal
 
	 */
 
	bool SameSource(CargoPacket *cp);
 
	bool SameSource(const CargoPacket *cp) const;
 
};
 

	
 
/**
 
 * Iterate over all _valid_ cargo packets from the given start
 
 * @param cp    the variable used as "iterator"
 
 * @param start the cargo packet ID of the first packet to iterate over
0 comments (0 inline, 0 general)