summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-03 13:52:06 +0000
committerrubidium <rubidium@openttd.org>2009-01-03 13:52:06 +0000
commit0d54db5f9fb3a3987f908645ca9693684f34674b (patch)
treed7251708eeba7b26d032505b22c0bb570da26501 /src/openttd.cpp
parentfa2bf69a5384a8035a92a069f47f31a178bc3f3c (diff)
downloadopenttd-0d54db5f9fb3a3987f908645ca9693684f34674b.tar.xz
(svn r14803) -Codechange: move order list management into it's own class and remove the order count from the savegame as we can easily count that (PhilSophus)
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index 488c969bd..6bb681788 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -2386,7 +2386,10 @@ bool AfterLoadGame()
Vehicle *v;
FOR_ALL_VEHICLES(v) {
- if (v->orders != NULL && !v->orders->IsValid()) v->orders = NULL;
+ if (v->orders.list != NULL && v->orders.list->GetFirstOrder() != NULL && !v->orders.list->GetFirstOrder()->IsValid()) {
+ v->orders.list->FreeChain();
+ v->orders.list = NULL;
+ }
v->current_order.ConvertFromOldSavegame();
if (v->type == VEH_ROAD && v->IsPrimaryVehicle() && v->FirstShared() == v) {