mirror of https://github.com/OpenTTD/OpenTTD.git
(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.
This commit is contained in:
parent
1c4f7001d4
commit
fe2e9ea795
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue