Changeset - r13204:037e2fceda8f
[Not reviewed]
master
0 2 0
rubidium - 15 years ago 2009-10-06 17:28:06
rubidium@openttd.org
(svn r17721) -Codechange: replace a magic number with a constant
2 files changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/cargopacket.cpp
Show inline comments
 
@@ -92,7 +92,7 @@ void CargoList::Append(CargoPacket *cp)
 
	assert(cp != NULL);
 

	
 
	for (List::iterator it = packets.begin(); it != packets.end(); it++) {
 
		if ((*it)->SameSource(cp) && (*it)->count + cp->count <= 65535) {
 
		if ((*it)->SameSource(cp) && (*it)->count + cp->count <= CargoPacket::MAX_COUNT) {
 
			(*it)->count        += cp->count;
 
			(*it)->feeder_share += cp->feeder_share;
 
			delete cp;
src/cargopacket.h
Show inline comments
 
@@ -45,6 +45,8 @@ private:
 
	/** We want this to be saved, right? */
 
	friend const struct SaveLoad *GetCargoPacketDesc();
 
public:
 
	/** Maximum number of items in a single cargo packet. */
 
	static const uint16 MAX_COUNT = UINT16_MAX;
 

	
 
	TileIndex source_xy;        ///< The origin of the cargo (first station in feeder chain)
 
	TileIndex loaded_at_xy;     ///< Location where this cargo has been loaded into the vehicle
0 comments (0 inline, 0 general)