diff options
author | rubidium <rubidium@openttd.org> | 2011-01-20 09:35:16 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-01-20 09:35:16 +0000 |
commit | 6a2ae9281159ad17a64f88d871561382ce366697 (patch) | |
tree | 34868a40d49e6a17c675474af40e5b4ed7603e93 /src/saveload | |
parent | 89a135293a0bbab3e9b669e71b21f5f0aa0621d8 (diff) | |
download | openttd-6a2ae9281159ad17a64f88d871561382ce366697.tar.xz |
(svn r21865) -Fix (r21862): don't perform savegame conversion when reinitialising some vehicle structures due to NewGRF changes
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/vehicle_sl.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/saveload/vehicle_sl.cpp b/src/saveload/vehicle_sl.cpp index f85719e38..d93b74989 100644 --- a/src/saveload/vehicle_sl.cpp +++ b/src/saveload/vehicle_sl.cpp @@ -296,31 +296,33 @@ void AfterLoadVehicles(bool part_of_load) } } - if (IsSavegameVersionBefore(105)) { - /* Before 105 there was no order for shared orders, thus it messed up horribly */ - FOR_ALL_VEHICLES(v) { - if (v->First() != v || v->orders.list != NULL || v->previous_shared != NULL || v->next_shared == NULL) continue; - - v->orders.list = new OrderList(NULL, v); - for (Vehicle *u = v; u != NULL; u = u->next_shared) { - u->orders.list = v->orders.list; + if (part_of_load) { + if (IsSavegameVersionBefore(105)) { + /* Before 105 there was no order for shared orders, thus it messed up horribly */ + FOR_ALL_VEHICLES(v) { + if (v->First() != v || v->orders.list != NULL || v->previous_shared != NULL || v->next_shared == NULL) continue; + + v->orders.list = new OrderList(NULL, v); + for (Vehicle *u = v; u != NULL; u = u->next_shared) { + u->orders.list = v->orders.list; + } } } - } - if (IsSavegameVersionBefore(157)) { - /* The road vehicle subtype was converted to a flag. */ - RoadVehicle *rv; - FOR_ALL_ROADVEHICLES(rv) { - if (rv->subtype == 0) { - /* The road vehicle is at the front. */ - rv->SetFrontEngine(); - } else if (rv->subtype == 1) { - /* The road vehicle is an articulated part. */ - rv->subtype = 0; - rv->SetArticulatedPart(); - } else { - NOT_REACHED(); + if (IsSavegameVersionBefore(157)) { + /* The road vehicle subtype was converted to a flag. */ + RoadVehicle *rv; + FOR_ALL_ROADVEHICLES(rv) { + if (rv->subtype == 0) { + /* The road vehicle is at the front. */ + rv->SetFrontEngine(); + } else if (rv->subtype == 1) { + /* The road vehicle is an articulated part. */ + rv->subtype = 0; + rv->SetArticulatedPart(); + } else { + NOT_REACHED(); + } } } } @@ -360,7 +362,7 @@ void AfterLoadVehicles(bool part_of_load) } /* Stop non-front engines */ - if (IsSavegameVersionBefore(112)) { + if (part_of_load && IsSavegameVersionBefore(112)) { FOR_ALL_VEHICLES(v) { if (v->type == VEH_TRAIN) { Train *t = Train::From(v); |