Mercurial > hg > openttd
changeset 7130:207700baed13 draft
(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.
author | peter1138 <peter1138@openttd.org> |
---|---|
date | Sun, 01 Jul 2007 12:25:08 +0000 |
parents | d2d416dbb0ba |
children | 107ab47b79c0 |
files | src/cargopacket.cpp |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -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;