mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-02-02 04:13:26 +00:00
(svn r16214) -Fix [FS#2878]: shared orders without orders weren't properly converted causing corrupt/invalid orders when loading pre 0.7 savegames.
This commit is contained in:
parent
4cd689035d
commit
73fd0db237
@ -298,6 +298,18 @@ void AfterLoadVehicles(bool part_of_load)
|
||||
}
|
||||
}
|
||||
|
||||
if (CheckSavegameVersion(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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CheckValidVehicles();
|
||||
|
||||
FOR_ALL_VEHICLES(v) {
|
||||
|
Loading…
Reference in New Issue
Block a user