Changeset - r20599:d47fae254933
[Not reviewed]
master
0 1 0
fonsinchen - 11 years ago 2013-07-30 19:03:56
fonsinchen@openttd.org
(svn r25637) -Fix: don't keep minimal routing information if automatic distribution has been disabled
1 file changed with 10 insertions and 3 deletions:
0 comments (0 inline, 0 general)
src/linkgraph/linkgraphjob.cpp
Show inline comments
 
@@ -74,14 +74,21 @@ LinkGraphJob::~LinkGraphJob()
 

	
 
		/* Swap shares and invalidate ones that are completely deleted. Don't
 
		 * really delete them as we could then end up with unroutable cargo
 
		 * somewhere. */
 
		for (FlowStatMap::iterator it(ge.flows.begin()); it != ge.flows.end(); ++it) {
 
		 * somewhere. Do delete them if automatic distribution has been turned
 
		 * off for that cargo, though. */
 
		for (FlowStatMap::iterator it(ge.flows.begin()); it != ge.flows.end();) {
 
			FlowStatMap::iterator new_it = flows.find(it->first);
 
			if (new_it == flows.end()) {
 
				it->second.Invalidate();
 
				if (_settings_game.linkgraph.GetDistributionType(this->Cargo()) != DT_MANUAL) {
 
					it->second.Invalidate();
 
					++it;
 
				} else {
 
					ge.flows.erase(it++);
 
				}
 
			} else {
 
				it->second.SwapShares(new_it->second);
 
				flows.erase(new_it);
 
				++it;
 
			}
 
		}
 
		ge.flows.insert(flows.begin(), flows.end());
0 comments (0 inline, 0 general)