diff options
author | frosch <frosch@openttd.org> | 2011-02-09 21:40:32 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-02-09 21:40:32 +0000 |
commit | b7713a7e8540aaf8d1181be8535132ba561f4364 (patch) | |
tree | 520a42af547affbdfd7948a67ec4318b8e0898fe /src/saveload | |
parent | 3a787f5a0b83c1bac9680a80b657601ce2d3bf5b (diff) | |
download | openttd-b7713a7e8540aaf8d1181be8535132ba561f4364.tar.xz |
(svn r22046) -Fix [FS#4487]: Make sure order indices stay in range when copying, sharing, unsharing or deleting all orders.
Diffstat (limited to 'src/saveload')
-rw-r--r-- | src/saveload/afterload.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/saveload/afterload.cpp b/src/saveload/afterload.cpp index 17ac9bc81..fe99e3c3e 100644 --- a/src/saveload/afterload.cpp +++ b/src/saveload/afterload.cpp @@ -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(); } |