(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:
rubidium 2009-05-03 11:57:01 +00:00
parent 4cd689035d
commit 73fd0db237

View File

@ -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) {