(svn r26700) -Fix [FS#6066]: incorrect saving of order backups

pull/155/head
rubidium 10 years ago
parent 0d2f141c10
commit a1f31b735a

@ -253,9 +253,11 @@ const SaveLoad *GetOrderBackupDescription()
SLE_VAR(OrderBackup, user, SLE_UINT32),
SLE_VAR(OrderBackup, tile, SLE_UINT32),
SLE_VAR(OrderBackup, group, SLE_UINT16),
SLE_VAR(OrderBackup, service_interval, SLE_UINT32),
SLE_CONDVAR(OrderBackup, service_interval, SLE_FILE_U32 | SLE_VAR_U16, 0, 191),
SLE_CONDVAR(OrderBackup, service_interval, SLE_UINT16, 192, SL_MAX_VERSION),
SLE_STR(OrderBackup, name, SLE_STR, 0),
SLE_VAR(OrderBackup, clone, SLE_UINT16),
SLE_CONDNULL(2, 0, 191), // clone (2 bytes of pointer, i.e. garbage)
SLE_CONDREF(OrderBackup, clone, REF_VEHICLE, 192, SL_MAX_VERSION),
SLE_VAR(OrderBackup, cur_real_order_index, SLE_UINT8),
SLE_CONDVAR(OrderBackup, cur_implicit_order_index, SLE_UINT8, 176, SL_MAX_VERSION),
SLE_CONDVAR(OrderBackup, current_order_time, SLE_UINT32, 176, SL_MAX_VERSION),
@ -295,10 +297,11 @@ void Load_BKOR()
}
/* Only load order-backups for network clients.
* If we are a network server or not networking, then we just loaded
* a previously saved-by-server savegame. There are
* no clients with a backup anymore, so clear it. */
if (!_networking || _network_server) {
* If we are a network server or not networking, then we just loaded a previously
* saved-by-server savegame. There are no clients with a backup, so clear it.
* Furthermore before savegame version 192 the actual content was always corrupt.
*/
if (!_networking || _network_server || IsSavegameVersionBefore(192)) {
_order_backup_pool.CleanPool();
}
}

@ -259,8 +259,9 @@
* 189 26450
* 190 26547
* 191 26646
* 192 26700
*/
extern const uint16 SAVEGAME_VERSION = 191; ///< Current savegame version of OpenTTD.
extern const uint16 SAVEGAME_VERSION = 192; ///< Current savegame version of OpenTTD.
SavegameType _savegame_type; ///< type of savegame we are loading

Loading…
Cancel
Save