(svn r22046) -Fix [FS#4487]: Make sure order indices stay in range when copying, sharing, unsharing or deleting all orders.

This commit is contained in:
frosch
2011-02-09 21:40:32 +00:00
parent 84514c8333
commit d762b17f40
3 changed files with 27 additions and 8 deletions

View File

@@ -2564,6 +2564,9 @@ bool AfterLoadGame()
FOR_ALL_VEHICLES(v) {
if (!v->IsPrimaryVehicle()) continue;
/* Older versions are less strict with indices being in range and fix them on the fly */
if (v->cur_auto_order_index >= v->GetNumOrders()) v->cur_auto_order_index = 0;
v->cur_real_order_index = v->cur_auto_order_index;
v->UpdateRealOrderIndex();
}