summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2014-01-24 21:39:07 +0000
committerfonsinchen <fonsinchen@openttd.org>2014-01-24 21:39:07 +0000
commit95354136be5de6055302fa1b992b86ec40a010c6 (patch)
tree940ac6e6a61bd55949e296bcffa247645311f5a6 /src
parent932dad7c8b24e5a1010126e1746034db3e9942e5 (diff)
downloadopenttd-95354136be5de6055302fa1b992b86ec40a010c6.tar.xz
(svn r26276) -Fix [FS#5874]: Don't spawn link graph jobs for link graphs with only one node
Diffstat (limited to 'src')
-rw-r--r--src/linkgraph/linkgraphschedule.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/linkgraph/linkgraphschedule.cpp b/src/linkgraph/linkgraphschedule.cpp
index f056d7cfc..b3e6fac2f 100644
--- a/src/linkgraph/linkgraphschedule.cpp
+++ b/src/linkgraph/linkgraphschedule.cpp
@@ -57,6 +57,12 @@ void LinkGraphSchedule::SpawnNext()
{
if (this->schedule.empty()) return;
LinkGraph *next = this->schedule.front();
+ LinkGraph *first = next;
+ while (next->Size() < 2) {
+ this->schedule.splice(this->schedule.end(), this->schedule, this->schedule.begin());
+ next = this->schedule.front();
+ if (next == first) return;
+ }
assert(next == LinkGraph::Get(next->index));
this->schedule.pop_front();
if (LinkGraphJob::CanAllocateItem()) {