summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
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) {