Changeset - r7130:1067231b5536
[Not reviewed]
master
0 1 0
peter1138 - 17 years ago 2007-07-01 12:25:08
peter1138@openttd.org
(svn r10404) -Fix (r10266): Adding a cargo packet to cargo list could overflow. Now we detect this and just leave the cargo in its own packet.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/cargopacket.cpp
Show inline comments
 
@@ -228,7 +228,7 @@ void CargoList::Append(CargoPacket *cp)
 
	assert(cp->IsValid());
 

	
 
	for (List::iterator it = packets.begin(); it != packets.end(); it++) {
 
		if ((*it)->SameSource(cp)) {
 
		if ((*it)->SameSource(cp) && (*it)->count + cp->count <= 65535) {
 
			(*it)->count        += cp->count;
 
			(*it)->feeder_share += cp->feeder_share;
 
			delete cp;
0 comments (0 inline, 0 general)