Chunnel: Save/load changes

pull/16/head
Jonathan G Rennison 8 years ago
parent aac5b2d4ad
commit 75410ddae4

@ -2030,7 +2030,7 @@ bool AfterLoadGame()
}
/* Tunnel pool has to be initiated before reservations. */
if (IsSavegameVersionBefore(196)) {
if (SlXvIsFeatureMissing(XSLFI_CHUNNEL)) {
for (TileIndex t = 0; t < map_size; t++) {
if (IsTunnelTile(t)) {
DiagDirection dir = GetTunnelBridgeDirection(t);

@ -74,6 +74,7 @@ const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
{ XSLFI_EXTENDED_GAMELOG, XSCF_NULL, 1, 1, "extended_gamelog", NULL, NULL, NULL },
{ XSLFI_STATION_CATCHMENT_INC, XSCF_NULL, 1, 1, "station_catchment_inc", NULL, NULL, NULL },
{ XSLFI_CUSTOM_BRIDGE_HEADS, XSCF_NULL, 1, 1, "custom_bridge_heads", NULL, NULL, NULL },
{ XSLFI_CHUNNEL, XSCF_NULL, 1, 1, "chunnel", NULL, NULL, "TUNN" },
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
};

@ -48,6 +48,7 @@ enum SlXvFeatureIndex {
XSLFI_EXTENDED_GAMELOG, ///< Extended gamelog
XSLFI_STATION_CATCHMENT_INC, ///< Station catchment radius increase
XSLFI_CUSTOM_BRIDGE_HEADS, ///< Custom bridge heads
XSLFI_CHUNNEL, ///< Tunnels under water (channel tunnel)
XSLFI_RIFF_HEADER_60_BIT, ///< Size field in RIFF chunk header is 60 bit
XSLFI_HEIGHT_8_BIT, ///< Map tile height is 8 bit instead of 4 bit, but savegame version may be before this became true in trunk

@ -270,7 +270,7 @@
* 194 26881 1.5.x, 1.6.0
* 195 27572 1.6.x
*/
extern const uint16 SAVEGAME_VERSION = 196; ///< Current savegame version of OpenTTD.
extern const uint16 SAVEGAME_VERSION = 195; ///< Current savegame version of OpenTTD.
const uint16 SAVEGAME_VERSION_EXT = 0x8000; ///< Savegame extension indicator mask
SavegameType _savegame_type; ///< type of savegame we are loading

@ -18,9 +18,9 @@
static const SaveLoad _tunnel_desc[] = {
SLE_CONDVAR(Tunnel, tile_n, SLE_UINT32, 196, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, tile_s, SLE_UINT32, 196, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, is_chunnel, SLE_BOOL, 196, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, tile_n, SLE_UINT32, 0, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, tile_s, SLE_UINT32, 0, SL_MAX_VERSION),
SLE_CONDVAR(Tunnel, is_chunnel, SLE_BOOL, 0, SL_MAX_VERSION),
SLE_END()
};

Loading…
Cancel
Save