Add an extended version feature for map sizes > 8kx8k.
This is to prevent earlier versions from trying to load the savegame and aborting.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include "../debug.h"
|
||||
#include "saveload.h"
|
||||
#include "extended_ver_sl.h"
|
||||
#include "../map_func.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -45,6 +46,7 @@ std::vector<uint32> _sl_xv_discardable_chunk_ids; ///< list of chunks
|
||||
static const uint32 _sl_xv_slxi_chunk_version = 0; ///< current version os SLXI chunk
|
||||
|
||||
const SlxiSubChunkInfo _sl_xv_sub_chunk_infos[] = {
|
||||
{ XSLFI_EXTRA_LARGE_MAP, XSCF_NULL, 0, 1, "extra_large_map", NULL, NULL, NULL },
|
||||
{ XSLFI_NULL, XSCF_NULL, 0, 0, NULL, NULL, NULL, NULL },// This is the end marker
|
||||
};
|
||||
|
||||
@@ -108,6 +110,9 @@ void SlXvSetCurrentState()
|
||||
for (; info->index != XSLFI_NULL; ++info) {
|
||||
_sl_xv_feature_versions[info->index] = info->save_version;
|
||||
}
|
||||
if (MapSizeX() > 8192 || MapSizeY() > 8192) {
|
||||
_sl_xv_feature_versions[XSLFI_EXTRA_LARGE_MAP] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -21,6 +21,7 @@
|
||||
*/
|
||||
enum SlXvFeatureIndex {
|
||||
XSLFI_NULL = 0, ///< Unused value, to indicate that no extended feature test is in use
|
||||
XSLFI_EXTRA_LARGE_MAP, ///< Extra large map
|
||||
|
||||
XSLFI_SIZE, ///< Total count of features, including null feature
|
||||
};
|
||||
|
Reference in New Issue
Block a user