Changeset - r20404:563b41d15037
[Not reviewed]
master
0 1 0
fonsinchen - 11 years ago 2013-06-15 20:48:50
fonsinchen@openttd.org
(svn r25419) -Fix: assign some random other source station to packets which have lost their source
1 file changed with 5 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/cargopacket.cpp
Show inline comments
 
@@ -450,6 +450,11 @@ bool VehicleCargoList::Stage(bool accept
 
			assert((cargo_next != next_station || cargo_next == INVALID_STATION) &&
 
					cargo_next != current_station);
 
		} else {
 
			/* Rewrite an invalid source station to some random other one to
 
			 * avoid keeping the cargo in the vehicle forever. */
 
			if (cp->source == INVALID_STATION && !ge->flows.empty()) {
 
				cp->source = ge->flows.begin()->first;
 
			}
 
			cargo_next = ge->GetVia(cp->source);
 
			if (cargo_next == INVALID_STATION) {
 
				action = (accepted && cp->source != current_station) ? MTA_DELIVER : MTA_KEEP;
0 comments (0 inline, 0 general)