mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r17721) -Codechange: replace a magic number with a constant
This commit is contained in:
parent
5f59d0c5b4
commit
e0e5eae1ee
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue