diff --git a/src/kernel/save.c b/src/kernel/save.c index 467d5847b..aa6f85d83 100644 --- a/src/kernel/save.c +++ b/src/kernel/save.c @@ -1502,7 +1502,6 @@ int readgame(const char *filename, bool backup) fstream_init(&strm, F); binstore_init(&store, &strm); gdata.store = &store; - global.data_version = gdata.version; /* FIXME: hack! attribute::read does not have access to gamedata, only storage */ if (gdata.version >= BUILDNO_VERSION) { int build; @@ -1835,7 +1834,6 @@ int writegame(const char *filename) gdata.store = &store; gdata.version = RELEASE_VERSION; - global.data_version = RELEASE_VERSION; // FIXME: no code that is writing should need this n = STREAM_VERSION; fwrite(&gdata.version, sizeof(int), 1, F); fwrite(&n, sizeof(int), 1, F); diff --git a/src/kernel/save.test.c b/src/kernel/save.test.c index 12e0d5311..4d8176756 100644 --- a/src/kernel/save.test.c +++ b/src/kernel/save.test.c @@ -37,7 +37,6 @@ static void test_readwrite_data(CuTest * tc) test_cleanup(); CuAssertIntEquals(tc, 0, writegame(filename)); CuAssertIntEquals(tc, 0, readgame(filename, false)); - CuAssertIntEquals(tc, RELEASE_VERSION, global.data_version); join_path(datapath(), filename, path, sizeof(path)); CuAssertIntEquals(tc, 0, remove(path)); test_cleanup(); @@ -87,7 +86,6 @@ static void test_readwrite_attrib(CuTest *tc) { key_set(&a, 42); mstream_init(&data.strm); gamedata_init(&data, &store, RELEASE_VERSION); - global.data_version = RELEASE_VERSION; // FIXME: hack! write_attribs(data.store, a, NULL); a_removeall(&a, NULL); CuAssertPtrEquals(tc, 0, a); diff --git a/src/kernel/version.h b/src/kernel/version.h index e4df97303..94e8e547c 100644 --- a/src/kernel/version.h +++ b/src/kernel/version.h @@ -35,8 +35,8 @@ #define ATTRIBOWNER_VERSION 350 /* all attrib_type functions know who owns the attribute */ #define BADCRYPT_VERSION 351 /* passwords are encrypted, poorly */ #define ATHASH_VERSION 352 /* attribute-type hash, not name */ -#define CRYPT_VERSION 353 /* passwords are encrypted */ -#define NOWATCH_VERSION 354 /* plane->watchers is gone */ -#define RELEASE_VERSION ATHASH_VERSION /* current datafile */ +#define NOWATCH_VERSION 353 /* plane->watchers is gone */ +#define CRYPT_VERSION 354 /* passwords are encrypted */ +#define RELEASE_VERSION NOWATCH_VERSION /* current datafile */ #define MIN_VERSION INTPAK_VERSION /* minimal datafile we support */ #define MAX_VERSION RELEASE_VERSION /* change this if we can need to read the future datafile, and we can do so */ diff --git a/src/triggers/createunit.c b/src/triggers/createunit.c index 31dfaaf7b..6e98901ca 100644 --- a/src/triggers/createunit.c +++ b/src/triggers/createunit.c @@ -107,7 +107,7 @@ static int createunit_read(trigger * t, gamedata *data) // read_reference(&td->f, store, read_faction_reference, resolve_faction); read_reference(&td->r, data, read_region_reference, - RESOLVE_REGION(global.data_version)); + RESOLVE_REGION(data->version)); td->race = (const struct race *)read_race_reference(data->store).v; if (!td->race) { result = AT_READ_FAIL;