summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-04-20 08:00:30 +0000
committerrubidium <rubidium@openttd.org>2007-04-20 08:00:30 +0000
commitfdf86bb4a2682eca65d6eefe89c7023cd91d7630 (patch)
treee4ded69f86472e9bdd57f0fb69b501f675b34a9a /src/openttd.cpp
parenta8350e5fdf4e11599bfadfed80775aa6639b1322 (diff)
downloadopenttd-fdf86bb4a2682eca65d6eefe89c7023cd91d7630.tar.xz
(svn r9683) -Fix [FS#423]: improved loading does not use a huge amount of processing power anymore when having a lot of trains.
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 7d342a3de..b5a8b385f 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -1926,6 +1926,18 @@ bool AfterLoadGame()
}
}
+ if (CheckSavegameVersion(57)) {
+ Vehicle *v;
+ /* Added a FIFO queue of vehicles loading at stations */
+ FOR_ALL_VEHICLES(v) {
+ if ((v->type != VEH_TRAIN || IsFrontEngine(v)) && // for all locs
+ !(v->vehstatus & (VS_STOPPED | VS_CRASHED)) && // not stopped or crashed
+ v->current_order.type == OT_LOADING) { // loading
+ GetStation(v->last_station_visited)->loading_vehicles.push_back(v);
+ }
+ }
+ }
+
return true;
}