(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.
authorpeter1138
Sun, 01 Jul 2007 12:25:08 +0000
changeset 7626 baab18f2a00c
parent 7625 1dba39e8e1e2
child 7627 17d48c4a22ca
(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.
src/cargopacket.cpp
--- a/src/cargopacket.cpp	Sat Jun 30 19:46:18 2007 +0000
+++ b/src/cargopacket.cpp	Sun Jul 01 12:25:08 2007 +0000
@@ -228,7 +228,7 @@
 	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;